A
Aaron Gray
The following input checkbox onclick via DOM is not working on IE7, FF, or
WebKit, but is working on Opera for some strange reason.
http://www.aarongray.org/Test/JavaScript/checkbox.html
Here's the code :-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" src="LibJS.js"></script>
</head>
<body onLoad="init()">
<script>
use( LibJS.HTML)
function init()
{
test = document.createElement( "INPUT")
test.type = "checkbox"
test.checked = true
test.onClick = "alert( 'test = ' + this.checked)"
// test.setAttribute( "onClick", "alert( 'test = ' + this.checked)")
document.body.appendChild( test)
}
</script>
</body>
</html>
Hope I have not missed something too silly.
Many thanks in advance,
Aaron
WebKit, but is working on Opera for some strange reason.
http://www.aarongray.org/Test/JavaScript/checkbox.html
Here's the code :-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<script type="text/javascript" src="LibJS.js"></script>
</head>
<body onLoad="init()">
<script>
use( LibJS.HTML)
function init()
{
test = document.createElement( "INPUT")
test.type = "checkbox"
test.checked = true
test.onClick = "alert( 'test = ' + this.checked)"
// test.setAttribute( "onClick", "alert( 'test = ' + this.checked)")
document.body.appendChild( test)
}
</script>
</body>
</html>
Hope I have not missed something too silly.
Many thanks in advance,
Aaron