Hello people,
I have some code. There is a button and text. When the button has been pressed, the text font should increase by 1 pixel every time the button has been pressed. This is de code i have. It should work on this way but i made a mistake at “style.fontsize = fontsize + 1;” but i don’t know what the correct code is. Anyone else know?? U should really help me! Thanks.
Reckimo..
(CODE)
<script>
window.onload = function letsgo (){
document.getElementById(“tekst”).style.fontsize = fontsize + 1;
}
</script>
</head>
<body>
<h1 id=”tekst”>”Dit is een stuk tekst.”</h1>
<input type=”button” id=”knop” value=”verander kleur” onclick=”letsgo ();”>
</body>
</html>