"On Click Functions (Delegate Binging Means Dynamic)"
Bootstrap 3.3.0 Snippet by naimansari

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <div class="container"> <div class="row"> <button type="button" class="button">Show Text</button> <h2>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2> </div> </div>
$(document).ready(function(){ $(".button").click(function(){ $("h2").append("<span>Dynamic Content</span>"); }); /* $("h2 span").click(function(){ $(this).css({ 'color':'#ff0' }); }); */ $('body').on('click', 'h2 span', function(){ $(this).css({ 'color':'#ff0' }); }); /* $(document).on('click', 'h2', function(){ $(this).hide(); }); */ });

Related: See More


Questions / Comments: