I want to convert an input id string in a integer. I am testing this js functions, despite getPrice is working, getQty gives me "undifine" instead of a number. What is wrong?
function getPrice() {
var price = document.getElementById("priceTshirt").innerHTML;
document.getElementById("total-1").innerHTML = price;
}
getPrice();
function getQty() {
var qty = document.getElementById("qty1").innerHTML;
document.getElementById("demolish").innerHTML = qty;
qty = qty.parseInt;
}
getQty();