php - Button Click does not work after executing Ajax function -


i have readmore button generated ajax , using below code execute click event button, nothing happens.

the button when clicked should unhide div dynamic , generated ajax. dynamic content dealing ideas please. thanks.

jquery:

jquery(document).on('click', '#readmore', function(e){     e.preventdefault();     alert("you clicked button");     jquery("#bodytext").css("display", "block"); }); 

you have 2 options make work,

  1. convert button hyperlink e.preventdefault prevent click of button default behavior.
  2. remove e.preventdefault() code.

also make sure have included latest version of jquery. , write code in $.ready() like,

$(function(){     // code here }); 

now, try use 1 option above.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -