Pregunta

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>')")
¿Fue útil?

Solución

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top