I am very new to JavaScript, however I already seem semi-stumped.
The tutorial I am using, mentions that for tutorial example purposes they use
I know that I can use
When do you use
Otherwise, do you just use
Like I said, I'm very new to JavaScript, so it's all still very new to me.
Cheers,
Asher
The tutorial I am using, mentions that for tutorial example purposes they use
document.write()
however it suggests that I avoid using this as it will overwrite the whole HTML page.I know that I can use
document.getElementById()
for some things... however this begs my question:When do you use
document.write()
, when do you use document.getElementById()
and is there also another method you use to change/write to the HTML Document using JavaScript?Otherwise, do you just use
document.getElementById()
quite a lot in JavaScript?Like I said, I'm very new to JavaScript, so it's all still very new to me.
Cheers,
Asher
Comment