I have a html file:
<html>
<body>
<div id="1">
<table>
<tr>
<td><input giveBorder="no"></td>
<td><input giveBorder="no"></td>
<td><input giveBorder="yes"></td>
</tr>
<tr>
<td><input giveBorder="no"></td>
<td><input giveBorder="no"></td>
<td><input giveBorder="no"></td>
</tr>
</table>
</div>
<div id="2">
<table>
<tr>
<td><input giveBorder="yes"></td>
<td><input giveBorder="no"></td>
<td><input giveBorder="yes"></td>
</tr>
<tr>
<td><input giveBorder="yes"></td>
<td><input giveBorder="no"></td>
<td><input giveBorder="no"></td>
</tr>
</table>
</div>
<div id="3">
<table>
<tr>
<td><input giveBorder="no"></td>
<td><input giveBorder="no"></td>
<td><input giveBorder="no"></td>
</tr>
<tr>
<td><input giveBorder="no"></td>
<td><input giveBorder="no"></td>
<td><input giveBorder="no"></td>
</tr>
</table>
</div>
</body>
I'm iterating through all div's and now I need to search if entire table contains particular attribute and value. I need to search for giveBorder="yes"
in whole table. If it any of the field contains that then I need to set border for that table and set border colour to red using jQuery.
After iterating through div I tried
var par = $(this).parent('table');
if(par.has('giveBorder="yes"').length === 0) {
console.log("table has to be set red border");
}
How can I search for that attribute in enitre table, and set css for it?