wood burning stoves*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 60810
    
  65

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: 60810
    
  65

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: 60810
    
  65

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: 60810
    
  65

 
wood burning stoves
 
subject: jquery alert query out should be 3 elements but its telling 4 elements
 
Similar Threads
validation messages not displaying the error messages in the HTML boxes
jquery script not executing on the data values that are extracted from the database
how to add new row with choosen plugin
How to alert a value in <td> element tag ?
jQuery doubt with reference to Object Literal Example.