• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Removing DOM Element in jQuery

 
Ashwin Sridhar
Ranch Hand
Posts: 272
Flex Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am learning DOM structure in jQuery and trying to remove the parent element. Below is my code .



When I remove the parent of .fish, I assume the <ui> element within Spanish Combo to be removed, but all the elements are getting removed.

Could someone explain this.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When your HTML is invalidly structured, and even uses elements that don't actually exist, anything could happen. You should not be surprised that things go awry.

Before doing anything, validate your HTML and fix the problems.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use this to see your errors: http://validator.w3.org/
 
Ashwin Sridhar
Ranch Hand
Posts: 272
Flex Oracle Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Use this to see your errors: http://validator.w3.org/


This helped me to figure out problems with my HTML structure. Thank you.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic