jQuery styling if certain value requirements of a are met
I am learning jQuery atm and can't find my error here... actually the
"problem" is quite simple
if a td cell with the class "red" has a value > 50, make it red
the jQuery code
$(document).ready(function(){
var n = $(".red").val();
if (n > 50) {
$(".red").css("color", "red");
}
else {
$(".red").css("color", "blue");
}
});
do i have to use .each() here?
No comments:
Post a Comment