Does anyone can help me with applying jqueryUI method to dynamically generated content in my webapp.
This content here is generated dynamically through an ajax call-:
<div class="streamOptionsContainer">
<button id="delete_post" title="Delete Post"></button>
</div>
problem is that when I use jqueryUI method:-
$("button[id=delete_post]").button();
on the dynamically generated button it doesn’t work, while the above mentioned jqueryUI method is working for all static content.
Use
.on()method.Since you are using an ID, you can do this way:
Also, if you are loading it after an ajax call, you can use the
success:function in it.Correct my syntax if wrong. 🙂