• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jquery alert query out should be 3 elements but its telling 4 elements

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please properly indent your code when posting. Unindented code is very hard to read.

Open the JavaScript debugger in your browser and look at the DOM that's created from your HTML. (Not View Source -- look at the real DOM)

You will see that 4 is the correct value.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. You should also be using a more up-to-date version of jQuery at this point.
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just Observed in firebug extra <tbody> tag is automatically being created???

How is that possible
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Them's the rules. If you place a <tr> element outside of a <thead>, <tbody>, or <tfoot>, it will automatically be placed inside a <tbody>.

If you want that row to be in a <thead>, you'll need to do so explicitly.
 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Them's the rules. If you place a <tr> element outside of a <thead>, <tbody>, or <tfoot>, it will automatically be placed inside a <tbody>.

If you want that row to be in a <thead>, you'll need to do so explicitly.


Thank you Bear, that resolved the issue.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic