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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:25:16+00:00 2026-06-01T15:25:16+00:00

I am working on div which is hidden and has a show button. Once

  • 0

I am working on div which is hidden and has a “show” button. Once clicked it displays the content of the div “anotherdiv”. And the text of the button is change to “HIDE”. Following is my jquery code:

<button id = "visible" value = "0">SHOW</button>
$("#visible").click(function(){
  $this = $(this);
  var divValue = $this.attr('value');
  if (divValue == 1){
      $this.attr('value','0');
      $('#anotherdiv').slideUp(1000);
      $this.text('HIDE');
  }else{
      $this.attr('value','1');
      $('#anotherdiv').slideDown(1000);
      $this.text('HIDE');    
  }
});

This code works fine on Firefox, Chrome and Safari. But on IE, it works on first step, when SHOW button is clicked, the “anotherdiv” is open, the text of the botton is changed to “HIDE” and the value attribute is changed to ‘1’ . But when the “HIDE” button is clicked, the IE does not capture the value attribute. How can I solve this problem. There were some similar posts in Stackoverflow, but I could not find the definite answer. Thank you.

  • 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-01T15:25:18+00:00Added an answer on June 1, 2026 at 3:25 pm

    Data attributes should be stored with a “data-” prefix. Helpful site about custom data attributes:
    http://html5doctor.com/html5-custom-data-attributes/

    This updated version worked for me on IE8:
    http://jsfiddle.net/vSMK6/2/

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

Sidebar

Related Questions

I have a div show hide function which is working fine. when I click
I have a div positioning working which gets fired by the scroll-event. What happens
I am trying to center a div button and its not working here is
This script of mine has a function, which is not working the way, I
I am working on a form which has a small part that hides and
I'm working on a page on which I'm dynamically creating a Facebook Like button
I'm working on a new portfolio site which has a menu that looks like
I have some javascript which controls a hidden div. Now it works on most
I've been working on div with rounded corners. I've got it displaying properly in
The code below working for only first div. I can't display other divs when

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.