Q. When I try to run my script, the browser displays the actual script in the browser window instead of executing it. What did I do wrong?
A. This is most likely caused by one of three errors. First, you might be missing the beginning or ending
<script>tags. Check them, and verify that the first reads
Q. Why are the
<br />tags allowed in the statements to print the time? I thought HTML tags weren’t allowed within the
A. Because this particular tag is inside quotation marks, it’s considered a valid part of the script. The script’s output, including any HTML tags, is interpreted and displayed by the browser. You can use other HTML tags within quotation marks to add formatting, such as the
<h2>tags we added for the large clock display.