Reputation: 45
if (document.getElementById("td1").innerHTML == "word"){
$("td:first").html("another word");
}
I just want to check if this have this text .
Upvotes: 1
Views: 5147
Reputation: 76910
You mean
if($('#td1').text() === "word"){
$("td:first").html("another word");
}
this matches <div id=td1>word</div>
Upvotes: 3