KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
http://jsfiddle.net/WXG7V/ As you can see below, I have a simple div containing a row I would like to append to the end of my table. If I alert the contents of the div back to the screen using ".html()", jQuery strips out all of the td/tr tags. <html> <head> <title>jQuery Strips Table Tags</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <script type="text/javascript"> $(document).ready( function() { alert($("#newRow").html()); $(".tasks > tbody:last").append($("#newRow").html()); }); </script> </head> <body> <table class="tasks" style="margin-left: 0px;"> <tr> <th>Feeder ID</th> <th>From</th> <th>To</th> <th># Reels</th> <th>Reel Length</th> <th>Type</th> <th>Colour</th> </tr> </table> </div> <div id="newRow" style="display: none;"> <tr> <td><input type="text" name="feeder_id" id="feeder_id" /></td> <td><input type="text" name="from" id="from" /></td> <td><input type="text" name="to" id="to" /></td> <td><select name="number" id="number"> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option value=4>4</option> <option value=6>6</option> <option value=8>8</option> <option value=9>9</option> <option value=12>12</option> &l
Tags (comma-separated)
Save Edits
Cancel