The following input checkbox onclick via DOM is not working on IE7, FF, or
WebKit, but is working on Opera for some strange reason.
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.create Element( "INPUT")
test.type = "checkbox"
test.checked = true
test.onClick = "alert( 'test = ' + this.checked)"
// test.setAttribu te( "onClick", "alert( 'test = ' + this.checked)")
document.body.a ppendChild( 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.
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.create Element( "INPUT")
test.type = "checkbox"
test.checked = true
test.onClick = "alert( 'test = ' + this.checked)"
// test.setAttribu te( "onClick", "alert( 'test = ' + this.checked)")
document.body.a ppendChild( test)
}
</script>
</body>
</html>
Hope I have not missed something too silly.
Many thanks in advance,
Aaron
Comment