I think the problem is putting
script
in the
div
in question.
Think of it: you're putting the script as inner HTML of the element which you want to modify with other script. I don't see a sense.
Put the script in the HTML
head
(I would recommend, always). The element
div
always have
innerHTML
(you can make if empty in your HTML code).
How, Jim is right about
value
, you should not use it for
div
. You modification code is correct.
document.getElementById('getlikecode').innerHTML = facebooklike;
I recently tested such code, it works.
—SA