I have a html table and press a key in a table cell. Now I want to check if any of the following table rows has the background color #FFFFCC. I tried this with the jQuery-code
var t = $(this).closest('tr').nextAll('[background="#FFFFCC"]').eq(0);
if (t.length > 0)
//
but it does not work.
You’re trying to use an attribute-equals selector, which won’t work since
backgroundisn’t an attribute. What you need to do, I think, is: