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 9185005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:11:27+00:00 2026-06-17T19:11:27+00:00

I am new to javascript and also stackoverflow. Please bare my english knowledge and

  • 0

I am new to javascript and also stackoverflow.

Please bare my english knowledge and javascript knowledge.

Here it goes……
I have Select option dropdown in my page. And I have divs.

below is my code this is working fine in firefox but not in ie or google chrome

function show_visibility(){
for(var i = 0,e = arguments.length;i < e;i++){
var myDiv = document.getElementById(arguments[i]).style;
myDiv.display = 'block';
}
}

function hide_visibility(){
for(var i = 0,e = arguments.length;i < e;i++){
var myDiv = document.getElementById(arguments[i]).style;
myDiv.display = 'none';
}
}

and this is my html code………

<select style="width:205px;padding:4px;margin-left:1px;">
  <option onClick="show_visibility('foo1','foo4');hide_visibility('foo2','foo3', 'foo4','foo5','foo6','foo7') ">Program Eligibility Report</option>
  <option onClick="show_visibility('foo2','foo5');hide_visibility('foo1','foo3', 'foo4','foo6') ">Audit Report</option>
  <option onClick="show_visibility('foo3','foo6');hide_visibility('foo1','foo2', 'foo4','foo5') ">Status Change Report</option>
  <option value="option4">Family Affiliation Audit Report</option>
  <option value="option5">Marketing Category Report</option>
  <option value="option6">Pending Approval Report</option>
</select>

For the above code perfectly working in Firefox, but not in IE

Kindly help me here.

  • 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-06-17T19:11:28+00:00Added an answer on June 17, 2026 at 7:11 pm

    You need to hook into the onchange event of the SELECT itself, and from there determine which option was selected.

    <select onchange="selChange(this)">...
    

    JS:

    function selChange(select) {
        selectedValue = select.options[select.selectedIndex].value;
        if(selectedValue == 'whatever') {
        ....your code...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to stackoverflow and HTML/CSS/Javascript. I have four tabs and I want them
Im new to wordpress and also javascript and need a bit of help from
I'm using devise in my rails 3.2 application. I have a users/new page where
I am new to javascript and jquery guys plz help, I have a list
I have this javascript snippet which passes an id and the reffering page to
New to posting on stackoverflow here, so my apologies in advance if I messed
I have something like the StackOverflow's "Ask Question" page, where a text-box is used
I'm new to JavaScript and also the JQuery mobile framework is new to me.
I'm very new to Javascript and would appreciate ANY help! I'm also using a
I'm relatively new javascript, but I am comfortable in other languages. I'm trying to

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.