Reputation: 493
say for instance i have the following line:
var arrowBase = document.createElement('div')
Now within this div tag i want to add some HTML (i.e text).
Then i tried the following:
arrowBase.innerHTML('hello');
However this does nothing:S
i have also tried: arrowBase.HTML('hello');
But once again without any result
I know is that rather simple but in my search i could'nt find the answer hope someone is able to help me out here
Upvotes: 0
Views: 78
Reputation: 509
arrowBase.textContent = "HELLO"
also does the same thing but only text can be specified. Whereas in innerHTML
html tags can be specified along with the text.
Upvotes: 0
Reputation: 207511
Read the docs, it is not a method.
arrowBase.innerHTML = 'hello';
Upvotes: 6