Jquery Javascript function, simple error, can't find it!

Posted by CodingIsAwesome on Stack Overflow See other posts from Stack Overflow or by CodingIsAwesome
Published on 2010-05-30T03:37:17Z Indexed on 2010/05/31 1:32 UTC
Read the original article Hit count: 229

When my page loads it calls the function like below:

<body onLoad='changeTDNodes()'>

And the code it calls is below:

enter code here


<script src='jquery-1.4.2.min.js' type='text/javascript'></script>

<script>

function changeTDNodes() {
var threshValue = 10;
$(".threshold").each(function(elem) {
if($("b",elem).innerText > threshValue) {
elem.addClass("overThreshold");
}
});
});

}

I have the class setup correctly in CSS .overThreshold { td{font-size:72px;} th{font-size:72px;} }

But no classes are being changed, whats going on?

Thanks for all your help!

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about internet-explorer