Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function content(){
- alert("test");
- $(".two button").click(function(){
- var id = $(this).parent().attr("id");
- alert(id);
- });
- }
- $(document).on("click", ".two button", function(){
- // put a click hander on the document to process clicks
- // from buttons that are descendants of elements with class=two
- $('body').on('click', '.two button', function(){
- var id = $(this).parent().attr("id");
- alert(id);
- });
- $('#my-div').on('click', '.two button', function(){
- var id = $(this).parent().attr("id");
- alert(id);
- });
- $(".two button").on("click",function(){
- var id = $(this).parent().attr("id");
- alert(id);
- });
- function content(element){
- $(element).click(function(){
- var id = $(this).parent().attr("id");
- alert(id);
- });
- }
Add Comment
Please, Sign In to add comment