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.
The inner text of the below
<strong> onclick="this.innerText = 'Bold Text';">Text</strong>
The result is below. Click and see the text change!
var num = 142857;
document.getElementById('bold').innerText = num;
<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.