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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:29:17+00:00 2026-05-27T08:29:17+00:00

Code works perfectly in other browsers but not in IE7. Problem in IE7 is

  • 0

Code works perfectly in other browsers but not in IE7. Problem in IE7 is that the second level of the list(ul .opt_1) won’t show when the first level is selected.
Here’s the HTML part:

<input type="button" id="topic" value="please select a topic"/>
<div class="c"></div>
<ul id="opt_0">
<li class="opt_0">finance</li>
<ul class="opt_1">
<li>business</li>
<li>stock</li>
<li>company</li>
<li>startup</li>
</ul>
<li class="opt_0">IT</li>
<ul class="opt_1">
<li>internet</li>
<li>code</li>
<li>hardware</li>
</ul>
</ul>
<input type="hidden" name="topic"/>

and JS part:

$(function(){
$("#topic").click(function(){
    $("#opt_0").slideDown();
})
$(".opt_0").click(function(){
        $(".opt_0").removeClass("selected");
        $(this).addClass("selected");
        $(".opt_1").hide();
        $(this).next(".opt_1").show();
    })
$(".opt_1 li").click(function(){
    $("#opt_0").slideUp();
    $("#topic").val($(".selected").html()+">>"+$(this).html());
    $("input[name=\"topic\"]").val($(".selected").html()+";"+$(this).html());
})
})

You can see JS fiddle here:http://jsfiddle.net/lornechang/4BmPb/
How do I make it compatible with IE7? Thanks.

  • 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-27T08:29:18+00:00Added an answer on May 27, 2026 at 8:29 am

    Your html is not valid. I made the changes required to make it correct in this fiddle:

    http://jsfiddle.net/4BmPb/1/

    <input type="button" id="topic" value="please select a topic"/>
    <div class="c"></div>
    <ul id="opt_0">
        <li class="opt_0">finance</li>
        <li class="opt_1">
            <ul>
                <li>business</li>
                <li>stock</li>
                <li>company</li>
                <li>startup</li>
            </ul>
        </li>
    
        <li class="opt_0">IT</li>
        <li class="opt_1">
            <ul>
                <li>internet</li>
                <li>code</li>
                <li>hardware</li>
            </ul>
        </li>
    </ul>
    <input type="hidden" name="topic"/>
    

    A ul element can only contain li elements, not other ul elements.

    As far as why it works in other browsers, other browsers are not as strict as IE is with html structure. I tested this in IE9 which presented the same problem, have not tested in IE7 but I suspect it will work too.

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

Sidebar

Related Questions

I recently have a problem that my java code works perfectly ok on my
The following script below is not running in IE7 but works perfectly fine in
This is my code that works perfectly to post one object to my server.
I have the following code which works perfectly, but I want to allow access
The following code works fine in browsers other than IE. In IE, only the
This code works perfectly in Ubuntu, Windows, and Mac OS X. It also works
This code works perfectly except when you click on a link, The page is
The following code works perfectly. public class StaticClass { public static void main(String[] args)
I am using ASP.NET to transmit a .jar file. This code works perfectly on
This is kind of a brainteaser question, since the code works perfectly fine as-is,

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.