Results 1 to 2 of 2
Thread: jQuery - Bug in .html() method?
Feb 5, 2013, 07:13 #1
jQuery - Bug in .html() method?
Please take a look at the source here... http://jsbin.com/edozum/2/edit
Can someone please tell me why is the jquery .html() method is adding tbody tag when getting the html from the DIV?
Feb 5, 2013, 07:40 #2
- Join Date
- Jun 2007
- 208 Post(s)
- 12 Thread(s)
It's not a jQuery thing, it's a browser/HTML thing.
The <tbody> tag is not explicitly required in your markup, but it will be always included in the DOM.
To see what I mean, copy this file to your PC, run it, then examine the table using Chrome's dev tools (or similar). You will see a <tbody> tag there, too.
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Simple table</title> </head> <body> <table width="200" border="1"> <tr> <td> </td> </tr> </table> </body> </html>