I'm looking to replace the开发者_运维百科 text inside a <nobr>
but I can't figure out how.
It would be easy if I could do:
$('nobr:contains("Due")').replace('Due Date');
but there's another <nobr>
that has the word "Due"
in it and I don't want that affected.
What's the simplest way to find the <nobr>
that's exactly equal to "Due"
and replace it with "Due Date"
?
You could filter
all the nobr
elements to eliminate any whose text is not equal to "Due":
$("nobr").filter(function() {
return $(this).text() === "Due";
}).text("Due Date");
Here's a working example.
精彩评论