Results 1 to 2 of 2
-
2nd Aug 2011, 10:36 AM #1OPMember
Help Needed With Add and Remove Elements(JS)
hi,
i want two simple functions, one to add a input text field and the other to remove it dynamically.
code i am using:
Code:var x=0; function add() { var dId = "div"+x; x++; document.getElementById('extra').innerHTML += "<div id=\'"+dId+"\'>URL:<input type='text' name='url[]' value=''><a href=\"javascript:delete('"+dId+"')\">X</a></div><br />"; } function delete(div) { var d = document.getElementById('extra'); var d2 = document.getElementById(div); d.removeChild(d2); }
i don't want that output.
and i m using FF4 if it matters.Arpit15 Reviewed by Arpit15 on . Help Needed With Add and Remove Elements(JS) hi, i want two simple functions, one to add a input text field and the other to remove it dynamically. code i am using: var x=0; function add() { var dId = "div"+x; x++; Rating: 5
-
2nd Aug 2011, 07:26 PM #2MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comi'm not good in js but try this
Code:d2.parentNode.removeChild(d2);
JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Free .PSD's (Web elements and UI stuff)
By Bretteo in forum Contests & GiveawaysReplies: 0Last Post: 26th Jul 2012, 05:24 PM -
Key Elements of a WebSites
By todaydownload in forum Webmaster DiscussionReplies: 0Last Post: 26th Jul 2012, 11:51 AM -
CSS Elements - Frigging Search Bar
By br0daR1DDICK in forum Web Development AreaReplies: 9Last Post: 23rd Oct 2011, 11:01 PM -
Slide Tags Bypass Visible Post Elements
By Phamous in forum Feedback and SuggestionsReplies: 2Last Post: 7th Oct 2011, 06:51 AM -
Periodic Table of the Elements
By Profit in forum Useful SitesReplies: 1Last Post: 9th Jan 2011, 08:40 PM
themaCreator - create posts from...
Version 3.45 released. Open older version (or...