i have a nested buttons and im trying to add click events on it but it seems not to be working.
this is my object
<div id="ui-50">
<div class="ui-rpc" data-role="controlgroup" data-type="horizontal" >
<input type="button" id="rpc-bor" value="<<" />
<input type="button" id="rpc-back" value="<" />
<span style="margin:3px"></span>
<input type="text" id="rpc-jump" value="" />
<input type="button" id="rpc-next" value=">" />
<input type="button" id="rpc-eor" value=">>" />
<span style="margin:20px"></span>
<label id="rpc-current" >0</label>
<label id="rpc-separator" >/</label>
<label id="rpc-total" >0</label>
<span style="margin:20px"></span>
<label id="rpc-rpp" >0</label>
</div>
</div>
im trying to add click event on id=”rpc-eor” button using
$("#ui-50 .ui-rpc #rpc-eor").click(function(){
alert("yay!");
});
but the event wont fire. what is the matter? please help! thanks in advance
I am seeing the
console.logoutput as expected in this demo I ran in Chrome, using jQuery.mobile 1.0b1Note: there is no
document.ready()for jQuery.mobile so if you have wrapped the jQuery in justdocument.ready()then it might be causing your problem. It is better to bind on$("div:jqmData(role='page')").live('pageshow',...);to guarantee that the page is ready. That said, in this simple case it still works without the.livebind.