I have read several posts regarding usinq quotes in jQuery and have not been able to form my own query. I have to check a span tag for a particular string. The string i am searching for is: role="alert" (it has double quotes around the word alert.
$("span:contains('role="alert"')").each(function() {
alert($(this).text());
});
Can someone provide a query for this?
$("span:contains('role=\"alert\"')")
You can simply use:
$('span[role="alert"]').each(function() {
alert($(this).text());
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With