I am working in wordpress and my ajax function result showed one button whose html is mentioned below. Now I want to run a click event on that button but when I click it nothing happens. Below is the html and jquery code of the button I am using and kindly note that this button is shown as a result of an ajax operation. thanks !!
html
<input style="background-color:purple" id="readmore" type="button" value="Readmore!!" name="mybutton">
jquery
jQuery("#readmore").on('click', function(e){
e.preventDefault();
alert("you clicked the button");
jQuery("#bodytext").css("display","block");
});