Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java script remove element by id

 
namita sasa
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "just for that particular selection"?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And "permanently"?
 
namita sasa
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then don't remove them from the DOM. Simply hide them using CSS.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic