Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
97
rated 0 times [  100] [ 3]  / answers: 1 / hits: 41125  / 15 Years ago, thu, october 29, 2009, 12:00:00

I have a piece of the DOM that I'd like to insert into my page. Currently I'm just blindly using:



$(myblob).appendTo(someotherblob);


How do I do the same thing, but append myblob to the second to last row that is within someotherblob. someotherblob in this case is a table and I want to inject a row above the second to last one.


More From » jquery

 Answers
7
$('#mytable tr:last').before(<tr><td>new row</td></tr>)

[#98421] Monday, October 26, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
elliem

Total Points: 415
Total Questions: 117
Total Answers: 94

Location: American Samoa
Member since Fri, Aug 26, 2022
2 Years ago
;