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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:12:14+00:00 2026-06-11T03:12:14+00:00

HTML : <button id=hide_some_text>Hide</button> <div id=first>my name is Sea Mist and iam 19 years

  • 0

HTML :

<button id="hide_some_text">Hide</button>
<div id="first">my name is Sea Mist and iam 19 years old</div>
<div id="second" style="display: none">This is the hidden text to be printed and selected only when button is pressed</div>

JQUERY :

$("#hide_some_text").click(function(){
$("#second").toggle();
});

What i want :

If text under div tag “second” is visible only then it should be SELECTED and PRINTABLE
(PLZ note im working in IE) , if text under div tag “second” is hidden then it should not get SELECTED when i do a Ctrl+A -> Ctrl + V and also should not be displayed when i go for Print Preview

Note : im using IE , these problems dont occur in mozzila or chrome , but due to constraints i have to use IE so i need a IE specific solution

  • 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-11T03:12:16+00:00Added an answer on June 11, 2026 at 3:12 am

    Do something like this in your JavaScript:

    var cache;
    $("#hide_some_text").click(function(){
        if($("#second").is(":visible")) { //if it's not hidden
            cache = $("#second").html(); //cache the HTML
            $("#second").hide().html(""); //hide and empty HTML
        }
        else { //else, it's hidden
            $("#second").show().html(cache); //show and get back HTML
        }
    });
    $(document).ready(function() {
        $("#hide_some_text").click();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the HTML button tag but the style mentioned below should only
I would like to hide a div when a button is clicked and show
I have a html button linked to php page. The php page calls a
I am trying to generate a dynamic html button in c#,But buttons are being
What's a simple good way to find out if a html button (the newer
When in a FB app I want to press an html button and exit
I used the following code to post a search value via an html button.
I'm experimenting with HTML5's Drag and Drop. I'm trying to drag an html button.
I've 2 asp listbox controls and an html input button, and using js i
I am trying to change the checked attribute of dynamically created html radio button

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.