my dog learned polymorphism
The moose likes HTML, CSS and JavaScript and the fly likes java script remove element by id Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "java script remove element by id" Watch "java script remove element by id" New topic
Author

java script remove element by id

namita sasa
Ranch Hand

Joined: Apr 20, 2009
Posts: 56
When we use removeElement function, will it delete element permanently or just for that particular selection if I write it in onClick() event?

Help!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56232
    
  13

What do you mean by "just for that particular selection"?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

And "permanently"?
namita sasa
Ranch Hand

Joined: Apr 20, 2009
Posts: 56
I have three radio buttons. On page load, it preselects some choice and removes some fields. But, if user clicks on another choice now, all fields should exist and now again second radio button will remove some of them.
On page load, when button is pre-selected, if it permanently removes form fields, my second radio button won't work correctly.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56232
    
  13

Then don't remove them from the DOM. Simply hide them using CSS.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: java script remove element by id
 
Similar Threads
DTD content model question
finding previous element of current element
Problem with positioning div
Trying to create an array full of ongoing numbers with add/remove buttons, not showing up on page
html table to excel problem