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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:58:10+00:00 2026-06-02T00:58:10+00:00

This appears to be an IE-specific ‘feature’. I tested using IE8. User John H

  • 0

This appears to be an IE-specific ‘feature’. I tested using IE8. User John H has contributing by confirming in IE6 and IE7.

I have some text that gets built into my page and from the beginning of the element’s creation it has style = "display: none;"

I’m not using jQuery to hide the text and the text is not ‘showing up’. Although, for further disclosure, I do access the element’s contents using jQuery’s .html() method.

However, if the user selects text nearby my display:none element and copies what has been selected, the hidden text gets included. Just as though it had been displaying normally.

The markup looks like this:

...
<td align="left">
    Text they should see
    <div id="whateverButUnique" style="display:none;">Value I want hidden</div>
    Some other text
</td>

Here is a fiddle where I can reproduce the issue using IE<9.

While this is not a serious concern for this particular application, it caught me off-guard and I wondered if this is a ‘feature’ or if I was doing something incorrectly.

Most of the other questions I’ve seen regarding display:none had their posters’ content as visible. Again, my content is essentially invisible until selected, copied, and finally pasted.

Can I prevent Internet Explorer users from finding this content by copying / pasting? I realize they could see it in Developer Tools and by viewing the source.

Update: thanks to other user’s comments, I have also tried applying the style of visibility:hidden and z-index=-1. User John H has tried lots of other hiding attempts but IE is so far tenacious at allowing this feature to slip through. Thanks for all the great ideas!

Update: Thanks for asking Heather Walters; the values that I need to use on the page are available server-side only but I then use them after the page loads to generate a link using extra processing from an outside program via jQuery/AJAX. So I build the page with the values hidden but included and then operate on those hidden values to build something useful with them.

Once I am done using them to build something useful, though, I now realize I could wipe them all out via jQuery and take an extra performance hit. The following code would accomplish this for everyone that has javascript enabled:

$("[id^=whateverButUnique]").html("");

With potentially hundreds of elements on the page this extra processing is not ideal.

vega, I don’t believe this solution would work for me because I have to build the page and my hidden content on the server side. They are all built in a server-side loop with potentially hundreds of other elements so I have the choice to either build it in place while the server is laying everything out in a table (with hidden element included) or loop through it a second time (painful) and try to force the elements to display:none somewhere less likely to be selected.

Ohgodwhy, I wanted to believe in your solution. In IE8, the hidden field didn’t show up in notepad; however, I was able to copy the section and paste it into Microsoft Word. It was no longer hidden.

Another factor at work: this page is already pretty javascript heavy so I was hoping I could find a solution that would prevent IE from seeing the values without adding another pass through 100+ potential elements…but I might just have to.

Update: Robin Maben‘s suggestion looks like it will be a great workaround! His suggestion is to hide the values in the data-x custom HTML5 attribute. This appears to be working despite my (most likely) non HTML5 compliant page. Please up-vote his answer if you also consider it a valuable contribution.

Update: Confirmed. I have successfully implemented Maben’s suggestion and therefore have been able to reduce the number of DOM look-ups — one for every element on my page. I was already looping through all of the DIVs with items that I wanted to show, and now I can automatically access the data property at the same time. This looks like this in my implementation:

<div style="display:none" data-call-number="..." id="stackLocatorLinkFillUp...">...</div>

The ellipsis indicate unique-to-me operations going on. The id has a simple numerical indicator that increments one per record.

// Loop through all of the items on the page that start with my id
$("[id^=stackLocatorLinkFillUp]").each( function() {
    // ...
    // Grab the contents of the div
    var innerContent = $(this).html();
    // Extract the call number out of the data-call-number field
    var callNumPreEncoded = $(this).data("callNumber");
    // ...eventually...
    $(this).html(...).css("display","block");
});

Thanks everyone!

  • 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-02T00:58:12+00:00Added an answer on June 2, 2026 at 12:58 am

    The size display and position of the element doesn’t matter, it’s being selected because when you select things in IE<9, you are selecting html and then pasting that html, with hidden elements. IE9 and other browsers properly remove those hidden elements from the selection. The only way i know of to prevent it is to not have the hidden element in the dom.

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

Sidebar

Related Questions

I have googled and searched this site, but nothing specific appears and cannot get
UPDATE: This bug appears to be Browser Specific to Chrome. I've clicked the link
I have a div that drops down and appears using jQuery when a user
Sorry of this appears a bit simple a question, but is there a way
From what I've already read this appears to be impossible, but I wanted to
Possible Duplicate: Plugging in to Java compilers Edit - this appears to be a
I'm attempting to map values of properties (via reflection) between different objects. This appears
[Edited: After cross-testing on a fresh machine and some additional research, this appears to
I'm declaring an instance of a class like so: Matrix m; This appears to
This function appears to be a way to access all sorts of system values.

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.