Using the browser's Javascript console, modify font.html
by changing the following in the paragraph #text
:
Once you have achieved these modifications, add your code to the page so that clicking the "Prettify" button will apply them. A runnable solution is located here (Don't peek at the code!).
Now, make it so that the JavaScript code is unobtrusive - ie there is no onclick handler in the HTML file
<div>
<button id="prettify" onclick="prettify();">Prettify</button>
</div>
function prettify() {
var text = document.getElementById("text");
text.innerHTML = "Look! It's pretty!";
// font styles added by JS:
text.style.fontSize = "13pt";
text.style.fontFamily = "Comic Sans MS";
text.style.color = "red";
}