954,170 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Adding elements dynamically in javascript using jquery

hi,
in my case i want to add a new menu item(actually a div tag) to my existing menu when an event or method calling occurs. i want to append a div tag dynamically to my existing menu with all css and effects. so if you guys have a better idea for this matter plz let me know. that will be a great pleasure .

:)
thanks. regards.

udayanga...

udayangaS
Newbie Poster
6 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

Something like this will insert a div with class new_item before the element with class class_next

$('<div class="new_item"><\/div>').insertBefore('.class_next');
pritaeas
Posting Expert
Moderator
5,446 posts since Jul 2006
Reputation Points: 653
Solved Threads: 874
 

hey thanks , pritaeas for ur quick reply. i think this will help wit my matter. hope ur help again.
regards.
udayanga.

udayangaS
Newbie Poster
6 posts since Oct 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You