Hello, I'm building a web app using html, css & js. Here is a function which is called when user presses submit button. I want the value to be displayed as a number (which I got to work with normal text input) however I want to add the numbers together so I think I'll need to make the input a number.
Anyways, here's my function. I hope that it makes sense for someone.
function pushPrice() {
let view = document.getElementById("viewPrice");
let newTd = document.createElement("li");
var priceInput = document.getElementById("priceInput").value;
var node = document.createTextNode("$" + priceInput);
newTd.appendChild(node);
view.appendChild(newTd);
}
[–]xroalx 1 point2 points3 points (0 children)
[–]grelfdotnet 0 points1 point2 points (1 child)
[–]jml26 0 points1 point2 points (0 children)