Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-03-2009, 12:37 AM   PM User | #1
php_guest
New Coder

 
Join Date: Jun 2009
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
php_guest is an unknown quantity at this point
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');
            });
            });
php_guest is offline   Reply With Quote
Old 06-03-2009, 04:54 AM   PM User | #2
Eldarrion
Regular Coder

 
Join Date: Feb 2009
Location: Wheeling, IL
Posts: 358
Thanks: 5
Thanked 62 Times in 60 Posts
Eldarrion is on a distinguished road
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?
Eldarrion is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:27 PM.


Advertisement
Log in to turn off these ads.