I want to add or remove jquerymobile attribute data-role="button" from anchor tag on window resize means something like:
<a href=".." class="mobilebutton">Hello</a>
if(windowsize < 700)
$(".mobilebutton").attr("data-role", "button");
else
$(".mobilebutton").removeAttr("data-role");
But its not working may be because page is already created so adding data-role attribute have no effect because jquerymobile.js have no knowledge about this attribute which we added.
Can anyone tell me workaround for this?
You can call your logic in the pagecreate event which will fire before jQueryMobile enhances the markup.