| | |
Adding elements dynamically in javascript using jquery
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2009
Posts: 5
Reputation:
Solved Threads: 0
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...
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...
0
#2 Oct 30th, 2009
Something like this will insert a div with class new_item before the element with class class_next
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
$('<div class="new_item"><\/div>').insertBefore('.class_next');
"If it is NOT source, it is NOT software."
-- NASA
-- NASA
![]() |
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Need Help
- Next Thread: Google Maps Directions in infowindows
Views: 396 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxexample ajaxjspservlets array autoplay blackjack browser captcha captchaformproblem cart child class close codes date debugger dependent developer disablefirebug dom editor element embed engine enter events explorer ext file firefox flash form forms frameworks game gears getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe java javascript javascripthelp2020 jquery jsf jsp jump libcurl maps margin marquee masterpage math media menu object onerror onmouseoutdivproblem onreadystatechange parent passing paypal pdf php player position post programming prototype rated redirect safari scale scriptlets scroll search security size software solutions sources star stars stretch synchronous toggle tweet unicode variables web webkit webservice window \n





