I am having a problem while studying JavaScript.
I tried to make the font larger when I click the second button, but it does not work.
<!DOCTYPE html>
<html>
<body>
<h2>What can Javascript do?</h2>
<p id="demo">JavaScript can change HTML content.</p>
<button type = "button" onclick = 'document.getElementById("demo").innerHTML = "Hello JavaScript!"'>Change Text!</button>
<button type = "button" onclick = 'document.getElementById("demo").style.fontSize='45px''>Bigger Font!</button>
</body>
</html>
Q. Could you let me know the proper way of implementing the button?
Q. What should I do if I want 2 functions in the same button?
Thank you very much for it!
Aucun commentaire:
Enregistrer un commentaire