I'm using YUI framework to style my radiobuttons and want to use the oncheckedchanged event to redirect to another page. It works just fine with trad开发者_运维技巧itional radiobuttons but using with the YUI framework the oncheckedchanged event never fires. Almost as if YUI has a built in function replacing it. Are there any workarounds to this?
so YUI replaces <input type='radio'...
for some html that looks something like this <span><span><button /></span></span>
So whatever function you are attaching for the oncheckedchanged event, you probably would have to attach it as a click or change event using YUI's api, so it'd look something like this.
var buttonGroup = new YAHOO.widget.ButtonGroup("radiogroup"); //init buttons
var buttons = buttonGroup.getButtons(); //get the buttons
buttons[0].on('click', function(){alert('a');}); //attach event, you probably need to iterate the buttons array to attach events to all the buttons
精彩评论