Frage

I have some data in table like "< n/a>", and i need to get it by text in div, but don`t find how.

<div class="one">red</div>
<div class="one">green</div>
<div class="one"><n/a></div>

$("div.one:contains('<n/a>')")
War es hilfreich?

Lösung

I don't think the problem is the selector, it is the html, you might have to escape the < and > like

<div class="one">&lt;n/a&gt;</div>

Demo: Fiddle


Your html renders the content <n/a> as html elements... see the difference between the escaped version and non escaped version

enter image description here

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top