tags:

views:

334

answers:

4

The following script works fine in IE7 but fails to execute in Firefox 3. The div tag which was display: none; shows in IE but never in FF. I am not a client / javascript guy... thanks.

<script type="text/javascript">
//<![CDATA[
document.getElementById("Fred1_Panel").style.setAttribute("display","inline");//]]>

</script>
+4  A: 

This will work in both browsers:

document.getElementById("Fred1_Panel").style.display = 'inline';
Triptych
thanks. both fix my issue. gave the answer to the guy with the fewer points. sure wish I could assign "2" correct answers.
Andrew Robinson
@Andrew. Just FYI, typically you would accept the first answer if two are the same. Glad to help out.
Triptych
+6  A: 

try this:

document.getElementById("Fred1_Panel").style.display = '';

OR

document.getElementById("Fred1_Panel").style.display = 'inline';
REA_ANDREW
+2  A: 

In FF, starting with either Tools | Error Console, or FireBug's console is a good way to see what errors are occurring.

Richard
+1  A: 

This code should work:

document.getElementById("Fred1_Panel").style.display = "inline";

In general if you encounter problems in Firefox you can easily discover the exact problem (and maybe find out the solution) using Firebug plugin or simply seeing at the Error console.

collimarco