songpa7 (4) [Avatar] Offline
<p>Nice to see you.</p>
<h5>Good Bye</h5><body>

I want to change the above html codes as follows using jquery,

<p>Nice to see you</p>
<h5>See you </h5></body>

How can I do that?
Sorry, I'm not a professional...

Message was edited by:
bear.bibeault (675) [Avatar] Offline
Re: beginner's question
Well, your example HTML is invalid, so jQuery's not gonna let you create that exactly. smilie

But read the chapter on DOM manipulation (chapter 3). It's easy to insert new element types, for example:


and it's easy to change the content of an element:

$('h5').html('Something else');
songpa7 (4) [Avatar] Offline
Thank you for your kindness
Thank you for your kindness.

I'll probably work harder with chapter3.
bear.bibeault (675) [Avatar] Offline
Re: Thank you for your kindness
Give it a try and post your code.