2009-06-22, 02:02 AM
Oh thanks; I was used to seeing onClick in things like buttons and links, I didn't know it worked with divs too xd
So the function you found was able to allow the function test() to call upon the innerHTML of the div... but I think I'm doing something wrong since I still can't modify the innerHTML
for instance:
So the function you found was able to allow the function test() to call upon the innerHTML of the div... but I think I'm doing something wrong since I still can't modify the innerHTML
for instance:
Quote:<html>
<head>
<script type="text/javascript">
HTMLElement.prototype.setInnerHTML = function(stuff) { //perhaps should be prototype.innerHTML?
var element = this;
element.innerHTML = stuff;
return element;
}
function test() {
document.getElementById('test').innerHTML('stuff').style.textTransform = "uppercase";
}
</script>
</head><body>
<div id='test' onClick='test()'>stuff</div>
</body>
</html>

