Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
html/js question
#7
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:
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>
Reply


Messages In This Thread
html/js question - by butterfλi - 2009-06-21, 09:22 PM
html/js question - by Russt - 2009-06-21, 09:48 PM
html/js question - by butterfλi - 2009-06-21, 10:25 PM
html/js question - by Russt - 2009-06-21, 10:42 PM
html/js question - by butterfλi - 2009-06-21, 10:49 PM
html/js question - by Russt - 2009-06-21, 11:00 PM
html/js question - by butterfλi - 2009-06-22, 02:02 AM
html/js question - by Russt - 2009-06-22, 02:17 AM
html/js question - by butterfλi - 2009-06-22, 11:30 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)