Friday, 18 March 2016

Jquery click doesnt work on ajax generated content

jquery click doesnt work on ajax generated content


<html>
<head>
<title>snd<title>
</head>
<body>

<div>

<button class="my-click" >Click Me</button>

</div>

<script type="text/javascript">

//if use class name on click using .(dot) to refer the class
//if use id name on click using # to refer the id

$(document).on('click','.my-click',function(){

alert('hai');
});
</script>

</body>
</html>

0 comments:

Post a Comment

 
© 2013 Nsd Stack | Designed by Making Different | Provided by All Tech Buzz | Powered by Blogger