Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    click to id from external html, append

    When user click on Click me, one.html is loaded. Inside this html is <p id="test">Click me2 </p>. I want that after user click on Click me 2 (which appers after he click on first Click me) that second action append <p>third</p>' to #include2 (this id is from one.html).

    Is even possible to do that? Now when I click on Click me 2 nothing happen, like there is no second click function.

    I want to append <p> include on click a <p id="test"
    Code:
    $(function() {
    
                $('#clickme').click(function() {
                    $('#include').load('one.html');
                });
    
                });
    
    
                $('#test').click(function() {
                    $('<p>third</p>').appendTo('#include2');
                });
                });

  • #2
    Regular Coder
    Join Date
    Feb 2009
    Location
    Wheeling, IL
    Posts
    358
    Thanks
    5
    Thanked 62 Times in 60 Posts
    How about...

    Code:
    $('#include2').append('<p>third</p>');
    Did you even look up 'jQuery append' in google or their own API?
    The way to success is to assume that there are no impossible things. After all, if you think something is impossible, you will not even try to do it.

    How to ask smart questions?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •