Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript Problems in Firefox but not in IE Debugging problems VIsual Studio 2010
    primarykey
    data
    text
    <p>Help I'm very new with web developing using ASP.NET. Why is the my web app does not give the desired output like IE does when debugging my code below:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;&lt;/title&gt; &lt;style type="text/css"&gt; h1{color:Blue} h2{color:Red} &lt;/style&gt; &lt;script type="text/javascript"&gt; function ShowColor() { alert("You selected " + SelectColor.value); BodyContent.style.backgroundColor = SelectColor.value; } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="BodyContent"&gt; &lt;h1&gt;HelloWorld&lt;/h1&gt; &lt;h2&gt;Welcome&lt;/h2&gt; &lt;p&gt; This is my first Web Page&lt;/p&gt; &lt;hr /&gt; Please select color: &lt;select id="SelectColor"&gt; &lt;option value="white"&gt;white&lt;/option&gt; &lt;option value="yellow"&gt;yellow&lt;/option&gt; &lt;option value="silver"&gt;silver&lt;/option&gt; &lt;/select&gt; &lt;input id="ButtonColor" type="button" value="Select" onclick="ShowColor()" /&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Problem is that FF does not executes the javascript "ShowColor" when i clicked the Select button but IE does.</p> <p><img src="https://i.stack.imgur.com/p6R6I.png" alt="enter image description here"></p> <pre><code> function ShowColor() { alert("You selected " + SelectColor.value); BodyContent.style.backgroundColor = SelectColor.value; } </code></pre>
    singulars
    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.
 

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