Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7179865
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:13:40+00:00 2026-05-28T17:13:40+00:00

This code works in FF but not in IE . Im stumped why the

  • 0

This code works in FF but not in IE .

Im stumped why the “clickme” button is still invisible in IE..
Also pls change the button to custom image button.. you use any random image like image.JPG in the code

thanks for your help.

<html> 
<script language="javascript"> 
var myLink = ""; 
function hideMe() { 
    document.getElementById('btn3').style.visibility='hidden'; 
} 

function setMyAdd() { 
    location.href=myLink; 
} 


function checkForChange() { 

    document.getElementById('btn1').style.visibility='visible'; 
    document.getElementById('btn2').style.visibility='visible'; 

    var buttonSelected=selList.value; 

    // alert("Option Selected is : " + buttonSelected ); 

    if (buttonSelected=="optx") { 
    myLink = "myPage2.html"; 
    document.getElementById('btn1').style.visibility='hidden'; 
    document.getElementById('btn2').style.visibility='visible'; 
    document.getElementById('btn3').style.visibility='visible'; 
    } else { 
    myLink = "myPage1.html"; 
    document.getElementById('btn1').style.visibility='visible'; 
    document.getElementById('btn2').style.visibility='hidden'; 
    document.getElementById('btn3').style.visibility='visible'; 
    } 
} 
</script> 
<body onLoad="hideMe()"> 
<form> 
<select onChange="checkForChange()" id="selList"> 
    <option value="opt1">Option 1</option> 
    <option value="opt2">Option 2</option> 
    <option value="opt3">Option 3</option> 
    <option value="optx">Option X</option> 
</select>  
<BR><br> 
<input type=button value="Option 1,2,3" id="btn1"> 
<BR> 
<input type=button value="Option X" id="btn2"> 
<BR> 
<input type=button value="Click me" id="btn3" onClick="setMyAdd()"> 
</form> 
</body> 
</html>

The problem is that visible/hidden are not working in IE i.e. when I select any option, I won’t see third button Click me i.e. below codes are not working

    document.getElementById('btn1').style.visibility='hidden'; 
    document.getElementById('btn2').style.visibility='visible'; 
    document.getElementById('btn3').style.visibility='visible'; 

Same is working in FF.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:13:41+00:00Added an answer on May 28, 2026 at 5:13 pm

    visibility and display are different things, the same as their names mean. Both attributes are to be used for all the elements which have a display or a visibility.

    The visibility is simple. An element can be visible (‘visible’ value), hidden (‘hidden’ value).
    In case of the table’s elements, Mozilla uses also the ‘collapse’ value, but IE does not.

    The display is a more complex attribute. The values depends on the display type of the element (inline, block, list….). Regarding the table and table’s elements, Mozilla and IE have different visions. Moz uses the DOM values (see http://www.w3.org/TR/REC-CSS2/tables.html#q2 ) while IE simply uses ‘block’ value for as positive display.

    To avoid an intricate cross-browser solution for all these, in case of visibility, you mai use the pair ‘visible’/’hidden’, and in case of display you may use the pair ”/’none’ (that means you may use a blank value instead of ‘block’

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="Content-Style-Type" content="text/css">
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    <script type="text/javascript" > 
    function showhide(att,val){
    document.getElementById("hid").style[att]=val;
    }
    </script>
    </head>
    <body>
    <form name="myform">
    <table width="100%"  border="4" cellpadding="2" cellspacing="2">
        <tr>
            <td  class="tableheader" colspan="9">TS </td>
        </tr>
         <tbody id="hid">
        <tr>
            <td width="17%" class="labeltext">Tran Code</td>
            <td width="1%"  class="blanktext">:</td>
            <td colspan="4" class="blanktext">Name</td>
        </tr>
        <tr>
            <td width="17%" class="labeltext">Product Type</td>
            <td width="1%"  class="blanktext">:</td>
            <td colspan="4" class="blanktext">
            </td>
        </tr>
         </tbody>
        <tr>
           <td>
           </td>
        </tr>
    
    </table>
    Display
     <br>
    <input type="button" onclick="showhide('display','')" value="Display on">
    <input type="button" onclick="showhide('display','none')" value="Display off">
    <br>
    <br>
    Visibility
    <br>
    <input type="button" onclick="showhide('visibility','visible')" value="Visibility on">
    <input type="button" onclick="showhide('visibility','hidden')" value="Visibility off">
    </form>
    </body>
    </html>
    

    This code will work in IE and FF both places…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code works in a windows forms application (it shows the preview) but not
This javascript code does not work in IE8, but works in Firefox and Google
Apologies for this basic question, but I am noob stumped. The below code works
This piece of code used to work in MVC 1 but it does not
How can I do this? (The following code does NOT work, but I hope
This code works, but i dont understand why. With DeferredLoadingEnabld = false, I would
This code works great for generating thumbnails, but when given a very large (100MB+)
This code works fine to find an available room within certain date, but it
This code works when I try it from a .py file, but fails in
This code works fine in C#: Expression.Lambda(LambdaBody); But none of the methods for building

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.