Search and Top Navigation
Ticket #5261: test-button-events.html
File test-button-events.html, 1.0 KB (added by Wolfjourn, March 02, 2010 09:18PM UTC)
.button() change event test
<html>
<head>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/jquery-1.4.2.js"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/jquery-ui.js"></script>
<link href="http://jquery-ui.googlecode.com/svn/tags/latest/themes/base/jquery-ui.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<input name="1" id="id1" type="checkbox"/>
<label for="id1">Checkbox</label>
<script type="text/javascript">
$(function() {
$('#id1').button().change(function(e) {
console.log('change', e);
});
$('#id1').bind('change', function(e) {
console.log('bound change', e);
});
$("body").live('change', function(e) {
console.log('live change on body', e);
});
$(document).delegate('input', 'change', function(e) {
console.log('delegated input change', e);
});
$(document).change(function(e) {
console.log('delegated change on document', e);
});
});
</script>
</body>
</html>
Download in other formats:
Original Format
File test-button-events.html, 1.0 KB (added by Wolfjourn, March 02, 2010 09:18PM UTC)
.button() change event test
<html>
<head>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/jquery-1.4.2.js"></script>
<script src="http://jquery-ui.googlecode.com/svn/tags/latest/ui/jquery-ui.js"></script>
<link href="http://jquery-ui.googlecode.com/svn/tags/latest/themes/base/jquery-ui.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<input name="1" id="id1" type="checkbox"/>
<label for="id1">Checkbox</label>
<script type="text/javascript">
$(function() {
$('#id1').button().change(function(e) {
console.log('change', e);
});
$('#id1').bind('change', function(e) {
console.log('bound change', e);
});
$("body").live('change', function(e) {
console.log('live change on body', e);
});
$(document).delegate('input', 'change', function(e) {
console.log('delegated input change', e);
});
$(document).change(function(e) {
console.log('delegated change on document', e);
});
});
</script>
</body>
</html>