Reputation: 29737
var obj = document.getElementById("<%= tbUpdate.ClientID %>");
var colorid = obj.value;
$('.shade[colorId=colorid]').addClass('active');
the problem is with the colorId=colorid. I think jQuery thinks that it's string. How can I pass value from var colorid into selector?
Upvotes: 0
Views: 103
Reputation: 7280
If you want to use the value of colorId
you would need to pass a string to the jQuery selector using concatenation$('.shade[colorId=' + colorid + ']')
.
Upvotes: 1