0 Users appreciate this thread.
TUTORIAL: Changing text with buttons
TwilightWinter (2016-05-31 19:51:53)It is funny how some people start to teach something the minute they starting learning it.
✋
Tip: avoid using the incorrect case for HTML attributes. A noticeable example here would be 'onClick' when it should be all lowercase as 'onclick'. This is to avoid any breakages in browsers that would be case sensitive about HTML attributes and so that it is done properly.
Security researcher, web developer, artist, and tech enthusiast.
ik bby but you know
Security researcher, web developer, artist, and tech enthusiast.
Log in to submit a comment
Back to forum: Web Programming (HTML, JS, CSS, PHP, MySQL)
New registered users today: 7
Newest registered user: ElegantVulpes


This is a tutorial, do not close this.
This is how to make text change with buttons. First, type this code in:
<html>
<head>
<title>Changing text with buttons</title>
<script>
</script>
</head>
<body>
</body>
</html>
Once you have this done, add this in the <script></script> tags:
function changeText() {document.getElementById('text'
Next, add this in the <body></body> tags:
<div id='text'>This is old text.</div>
<button style='button' onClick='javascript:changeText();'>Change the text!</button>
That's it! Now save the page, and test it. Hope this helps!
2016-03-10 22:05:03