I'd like to update the value of a link-button by clicking on the item of a menu.

Html:

```
<div id="menu">
    <ul data-role="listview" data-icon="false">
        <li><a href="#">Value A</a></li>
        <li><a href="#">Value B</a></li>
    </ul>
</div>

<a href="#" id="selected" data-role="button"></a>

```

jQueryMobile:

```
$('#selected').hide();

$("#menu li a").on('click',function(){
    $('#selected').html($(this).html()).slideDown().button("refresh");
});

```

Text update works fine, but button css is not properly updated.

I get the following error: 

> 
> Uncaught Error: cannot call methods on button prior to initialization;
>  attempted to call method 'refresh'
> 
> 
> 

Which initialization are we talking about ? Page and button are already initialized, aren't they?

---

EDIT:

I also tried this :

```
$(document).on("mobileinit", function() {

    $('#selected').hide();

    $("#menu li a").on('click',function(){
        $('#selected').html($(this).html()).slideDown().button("refresh");
    });

});

```

No error message any more; but no text update :(