javascript - Which Jquery events should I use within an ajax modal? -


i have modal loaded via ajax, use .on() jquery bind events inside modal :

    $(document).on('click', '#mybutton', function() {           $('#mydiv').toggle();     }); 

i want toggle() div when modal called, event should use ?

i tried "load" doesn't works :

    $(document).on('load', function() {           $('#mydiv').toggle();     }); 

edit :

i found solution here : binding elements when modal window loads ajax (jquery)

try this

$('#mybutton').click(function() {      $('#mydiv').toggle();  }); 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -