I'm actually trying to use a js var in my html code like this :
In javascript code :
var test = 'This is a test';
And in the html :
<p>display var test here</p>
How can I display the value of my js var in html like this ?
I'm actually trying to use a js var in my html code like this :
In javascript code :
var test = 'This is a test';
And in the html :
<p>display var test here</p>
How can I display the value of my js var in html like this ?
HTML:
<p id="paragraph"></p>
JavaScript:
var test = 'This is a test';
document.getElementById('paragraph').innerHTML = test;