Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
html/js question
#1
Say I have this code
[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();
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)