Note that there are some explanatory texts on larger screens.

plurals
  1. POjavascript won't execute but prints code
    primarykey
    data
    text
    <p>I have some html code where the javascript code instead of executing it just shows the javascript code. This might be a simple question or dumb mistake but after searching some websites I can't seem to find the answer</p> <p>My code:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Daniel's Quicky Links&lt;/title&gt; &lt;style type="text/css"&gt; a { text-decoration:none; color:blue; } div.author { font-size:12px; text-align:center; position:absolute; bottom:0%; width:98%; margin-left:auto; margin-right:auto; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;p id="date"&gt;&lt;button onClick="printDay()"&gt;day&lt;/button&gt;&lt;/p&gt; &lt;table border="3" cellpadding="5" cellspacing="0" summary="This is a list of links to help you quickly guide through the internet" width="40%"&gt; &lt;caption&gt;This is a list of links to help you quickly guide through the internet&lt;/caption&gt; &lt;tr&gt; &lt;th&gt;Link&lt;/th&gt; &lt;th&gt;Use&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="http://google.com" target="_blank"&gt;Google&lt;/a&gt;&lt;/td&gt; &lt;td&gt;This link is to a great search engine&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="http://facebook.com" target="_blank"&gt;Facebook&lt;/a&gt;&lt;/td&gt; &lt;td&gt;This link is to a great social media outlet&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="http://wikipedia.org" target="_blank"&gt;Wikipedia&lt;/a&gt;&lt;/td&gt; &lt;td&gt;This link is to a great wiki containing information on plenty of topics&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="http://ask.com" target="_blank"&gt;Ask&lt;/a&gt;&lt;/td&gt; &lt;td&gt;This link is to a great forum you can ask questions&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;div class="author"&gt;&lt;p&gt; &lt;hr width="101%"&gt; Author: ********&lt;/br&gt; Version: 0.1&lt;/br&gt; Contact: &lt;a href="mailto:*********?Subject=Quicky Links complaint,suggestion,comment&amp;Body=My thoughts on Quicky Links"&gt;************&lt;/a&gt; &lt;/p&gt;&lt;/div &lt;script type="text/javascript"&gt; function printDay() { var x = new String(""); var day=new Date().getDay(); switch(day) { case 0: x="Today is Sunday"; break; case 1: x="Today is Monday"; break; case 2: x="Today is Tuesday"; break; case 3: x="Today is Wednesday"; break; case 4: x="Today is Thursday"; break; case 5: x="Today is Friday"; break; case 6: x="Today is Saturday"; break; default: x="Day does not exist"; } document.getElementById("date").innerHTML=x; } &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Thanks in advance! Dando18</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload