mercredi 5 août 2015

find a specific text in tr td jquery using contains [duplicate]


This question already has an answer here:

This is my fiddle of finding a text in tr.

I used

var reports = $('table#reports > tbody');
var tr1 = reports.find('tr:has(td:contains("First Name"))');

to find the text but even if the text does not exist it still alerts that it exists. To check if it exist i created an if

if (tr1) {
    alert('exist');
 } else {
    alert('not');
 }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire