jQuery: What is the problem with this jQuery.css() call?
IE doesn't like the sharp symbol in the line below
jQuery(this).css('background-color','#' + jQuery(this).prev().val());
so I'm wondering 开发者_开发知识库if there is a different way to write the same without get error in IE?
I've tested $(this).css('background-color', '#fff000');
in IE and it works fine so I don't think it's the sharp. It's how the color is either being constructed or an issue with quotes. Try:
var newColorTest1 = '#' + jQuery(this).prev().val();
alert(newColorTest1);
jQuery(this).css('background-color', newColorTest1);
What is shown in the alert box?
What is the value of jQuery(this).prev().val();
in your markup?
精彩评论