Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery: set value of table cell inside div

Tags:

jquery

I have a floating div which contains a title and I want to change that title. I tried this:

$("div#dragTitle3").text("New Title");

But the title is actually in a table inside the div. This is the table:

<table><tbody><tr><td>Announcements</td><td style="text-align:right"><img src="buttontop.png" class="divTitleButton" id="dragButton3" onmousedown="javascript:toggleContentWin(3)"></td></tr></tbody></table>

I want to know how I can change the title without entering the whole table's code when I set the new table.

like image 891
Hintswen Avatar asked Jun 02 '09 04:06

Hintswen


1 Answers

This should work:

$("div#dragTitle3 td:first").text("New title")
like image 199
Ronald Wildenberg Avatar answered Oct 21 '22 11:10

Ronald Wildenberg