Finding a div that contains some text
I have a web page with a lot of divs in it. Some of them contain names such as Smith, Ms Ruth.
I would like the page to load then perform the following code to find the Id of the div in which Ms Smith might be in.
The following code works well in a much smaller page with only 3 divs in it but does not seem to work with the large html page.
I have consulted google till my hair falls out.
Any ideas ?
var surname = "";
surname = prompt('What is name?');
alert(surname);//works fine up to here
var z = $("div:contains(surname)");
});//doesn't work ? But did on a smaller page
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)