When embedding inline CSS in an HTML tag, websites use the
One of these attributes is
onclick attribute gets executed when the HTML element is clicked.
Recommended Training – Treehouse
Although this site recommends various training services, our top recommendation is Treehouse.
Treehouse is an online training service that teaches web design, web development and app development with videos, quizzes and interactive coding exercises.
Treehouse's mission is to bring technology education to those who can't get it, and is committed to helping its students find jobs. If you're looking to turn coding into your career, you should consider Treehouse.
The inner text of the below
<strong> onclick="this.innerText = 'Bold Text';">Text</strong>
The result is below. Click and see the text change!
<script> var num = 142857; document.getElementById('bold').innerText = num; </script>
<script> tag is often placed as the last element inside a website’s
<body> element on a web page.
Stick around for the next tutorial, and you’ll learn how to write more simple scripts with PHP.
Disclosure of Material Connection: Some of the links in the post above are “affiliate links.” This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers.