my code here http://jsfiddle.net/GKZRU/14/
all js working properly, and add/remove css classes(checking this in chrome js console)
but inactive style doesnt apply, 🙁
i wanna grey background on radiobutton field that not choosen.
my code here http://jsfiddle.net/GKZRU/14/ all js working properly, and add/remove css classes(checking this in
Share
It’s because you’ve put your code in the “DOM ready” handler via the left-pannel jsFiddle control. The functions are not global.
Try changing the definitions of the functions. Instead of
try
Now, obviously in real code you wouldn’t need to do that. Another (better) idea would be to quit using “onchange” attributes to bind event handlers, and do things with jQuery (since you’re using the library anyway). Bind the handlers to the elements in your “ready” handler, and the functions need not be global (which is messy and icky anyway).