if (document.getElementById("td1").innerHTML == "word"){
$("td:first").html("another word");
}
I just want to check if this have this text .
You mean
if($('#td1').text() === "word"){
$("td:first").html("another word");
}
this matches <div id=td1>word</div>
$("#td1:contains('word')").html("another word");
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.