Say I have this code
[html]<div id='test'>sample</div> [/html]
to call upon that code I would normally use
But is there any way I can use the following code?
(if my vocab is right), in the code, innerHTML is an object. In order for the second code to work, innerHTML would need to be a method. Basically in the end what I'm looking to do is:
[html]<div id='test'>sample</div> [/html]
to call upon that code I would normally use
Code:
getElementById('test').innerHTML = 'sample';
//lets ignore doing it this way for the moment "getElementById('test')"But is there any way I can use the following code?
Code:
getElementById('test').innerHTML('sample');(if my vocab is right), in the code, innerHTML is an object. In order for the second code to work, innerHTML would need to be a method. Basically in the end what I'm looking to do is:
Code:
getElementById('test').innerHTML('sample').doFunctionHere();

![[Image: 30u8phi.png]](http://i41.tinypic.com/30u8phi.png)