0

Addclass isn't workign in IE in the following code:

$("tr").find("td:eq(0)").addClass("header").css("width","300px");
$("tr").find("td:eq(1)").addClass("data").css("width","500px;");
Matt Ball
  • 354,903
  • 100
  • 647
  • 710
Caveatrob
  • 12,667
  • 32
  • 107
  • 187

4 Answers4

0

$trFind = $("tr").find("td:eq(0)"); $trFind.addClass("header").css("width","300px");

That's how it should work.

ViktorPu
  • 25
  • 4
  • Why would this help at all? Chaining is an integral part of jQuery, and this is a case where it makes _total_ sense to use it. – Jordan Aug 26 '13 at 17:39
0

Maybe someone will still have the issue and looking for a solution:

jQuery Add and remove Classes not working IE8

Community
  • 1
  • 1
Patrick
  • 162
  • 2
  • 11
0

It was bad markup on my part. Didn't close "TD" tags and didn't remove a legacy "CENTER" tag on the page. Thanks all!

Caveatrob
  • 12,667
  • 32
  • 107
  • 187
-1

see that:

jQuery issue in Internet Explorer 8

Community
  • 1
  • 1
Arthur Neves
  • 11,840
  • 8
  • 60
  • 73