0
help me in my code. i want to display the value of 2 inputs and the textarea.
4 Réponses
+ 3
2 errors and 1 warning found:
Syntax error: getElementbyId, it's getElementById.
Element member error: div element cannot update with value attribute, it should be innerHTML or innerText.
Warning: script tag should be in the head tag or before the closing tag of body.
Correction:
function post() {
var a = document.getElementById("nameee").value;
var b = document.getElementById("dateee").value;
var c = document.getElementById("comment").value;
document.getElementById("posthere").innerHTML = a + b + c;
}
+ 2
function post() {
var a = document.getElementById("nameee").value;
var b = document.getElementById("dateee").value;
var c = document.getElementById("comment").value;
document.getElementById("posthere").innerHTML =
"<p>" + a + "</p>" +
"<p>" + b + "</p>" +
"<p>" + c + "</p>";
}
+ 1
Thank you so much @Calvin. You`re a big help :)
0
how can i make the output looks like this
Wilfred Florendo
09-13-18
This is a comment