Created
September 19, 2010 17:55
-
-
Save chrisgeo/586971 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head></head> | |
<body> | |
<form id="myform" name="myform"> | |
<input type="radio" name="rad" value="foo" /> | |
<input type="radio" name="rad" value="bar" /> | |
</form> | |
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.2.0/build/yui/yui-min.js"></script> | |
<script type="text/javascript"> | |
YUI({ | |
filter: 'debug', | |
charset: 'utf-8' | |
}).use('selector-css', 'node', 'event-simulate', function(Y){ | |
var radios = Y.all('form[name=myform] input[name=rad]'); | |
radios.on('click', function(e){ | |
console.log(e); | |
console.log('fired'); | |
}); | |
console.log(radios.item(1)); | |
//doesn't fire | |
radios.item(1).simulate('click'); | |
//does | |
//radios.item(1)._node.click(); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment