that's my code, I don't know why the + button doesn't increase. Everything seems correct to me. I created a function called incrementa() that should parse the value of the actual font size, and than increase the size of the font by 2 px.
function incrementa() {
var modifArea = document.getElementById("inser"); //prendo l'id inser (textarea)
var valTestoNum = parseInt(modifArea.style.fontSize); //trasformo il valore del font in int
modifArea.style.fontSize = valTestoNum + 2 + "px"; // incremento di 2. Quindi creo una stringa nuova sommando il valore precedente del font size a 2 e concateno a stringa "px"
console.log(modifArea.style.fontSize);
}
function decrementa() {
var modifArea = document.getElementById("inser");
var valTestoNum = parseInt(modifArea.style.fontSize);
modifArea.style.fontSize = valTestoNum - 2 + "px";
console.log(modifArea.style.fontSize);
}
#quadrato {
text-align: center;
/*centrare il form*/
}
#inser {
font-family: Arial;
height: 500px;
width: 500px;
font-size: 14px;
}
<div>
<form id="quadrato" method="POST">
<input type="button" value="+" onclick="incrementa()">
<input type="button" value="-" onclick="decrementa()">
<br>
<textarea id="inser"></textarea>
<br>
<input type="button" name="salva" value="salva">
<!--button o submit? -->
</form>
</div>