seanhalley
09-09-2010, 11:51 AM
Hi all,
Hope you can help with the following. I'm trying to change the contents of DIV2 when I click on DIV1. The following code doesn't work for some reason. I'm using Windows 7 (64-bit), and testing on Firefox 3.6.8 and IE8.
<html>
<head>
<script type="text/javascript" language="javascript">
function test() {
document.getElementById("test2").innerHMTL="hello";
}
</script>
</head>
<body>
<div id="test1" style="border: 1px solid #ff0000; width: 200px; height: 100px;" onclick="test();">Test Box 1</div>
<div id="test2" style="border: 1px solid #ff0000; width: 200px; height: 100px;">Test Box 2</div>
</body>
</html>
Any help appreciated,
Cheers
Sean
Hope you can help with the following. I'm trying to change the contents of DIV2 when I click on DIV1. The following code doesn't work for some reason. I'm using Windows 7 (64-bit), and testing on Firefox 3.6.8 and IE8.
<html>
<head>
<script type="text/javascript" language="javascript">
function test() {
document.getElementById("test2").innerHMTL="hello";
}
</script>
</head>
<body>
<div id="test1" style="border: 1px solid #ff0000; width: 200px; height: 100px;" onclick="test();">Test Box 1</div>
<div id="test2" style="border: 1px solid #ff0000; width: 200px; height: 100px;">Test Box 2</div>
</body>
</html>
Any help appreciated,
Cheers
Sean