views:

13

answers:

1

I am using this code to get all the tableheads which do not have colspan. It only works in firefox and chrome, but not in IE. What is the equivalent code for IE? thanks.

$tableHeaders = $("thead th:not([colspan])", table);
+1  A: 

Try:

$tableHeaders = $("#table_id th:not(:has(colspan))");

More:

http://api.jquery.com/has-selector/

As I've understood it :has() doesn't work in that way. As the documentations says: "Selects elements which contain at least one element that matches the specified selector."So not for attributes, just for child elements.
Peter Forss
no, it didn't work. I tried $tableHeaders = $("thead th:not(:has[colspan])", table);instead and did not work for IE only again.