so I'm pretty new with html and need some help.
I'm trying to make 3 buttons and each of them will change the text next to when you click on them. I am using the following code for each button:
<a href="#" onClick="document.getElementById('past').innerHTML='---future---';">
When I click on the button the text will change in the text after the innerHTML=" ". The problem is that one I add to much text on the places ---future--- it won't load it anymore in the browser. The screen just won't update. How do I overcome this problem? I've been having this problem for quite some time so any help will be appriciated.
To change font type purely with HTML, use the CSS font-family property. Set it to the value you want and place it inside a style attribute. Then add this style attribute to an HTML element, like a paragraph, heading, button, or span tag.
<script>
function changeText()
{
document.getElementById('boldStuff').innerHTML = 'Fred Flinstone';
}
</script>
<p>Welcome to the site <b id='boldStuff'>dude</b> </p>
<input type='button' onclick='changeText()' value='Change Text'/>
</body>
</html>
Try This Code. It Works For Me. In The Above Code I Have Used [bold] tag To Focus It You Can Use Acronym Tag.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With