aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes jquery alert query out should be 3 elements but its telling 4 elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "jquery alert query out should be 3 elements but its telling 4 elements" Watch "jquery alert query out should be 3 elements but its telling 4 elements" New topic
Author

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

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055



http://www.lifesbizzare.blogspot.com || OCJP:81%
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

P.S. You should also be using a more up-to-date version of jQuery at this point.
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

I just Observed in firebug extra <tbody> tag is automatically being created???

How is that possible
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61437
    
  67

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

Joined: Aug 01, 2009
Posts: 1055

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

Joined: Jan 10, 2002
Posts: 61437
    
  67

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