0

I need to find a way to prevent the user from copy and pasting a particular DIV in an html file. I am limited to HTML and Javascript as this wont be hosted on a real webserver, just a network drive. I am also stuck dealing with IE8 specifically.

Basically the page has 2 main DIVs. One visible and One not (long story) but I need a way to make it so that if a user highlights the entire page or CTRL-A's, they dont get the content of the second DIV.

Any ideas?

TetraFlash
  • 315
  • 7
  • 18
  • 1
    http://stackoverflow.com/questions/6214128/text-unselectable-in-ie – Prinzhorn Oct 11 '13 at 17:39
  • 1
    Keep in mind it still can be copied from page source – Yuriy Galanter Oct 11 '13 at 17:40
  • I read that alraedy. If you read the solution in that post it specifically mentions you can still copy text in an unselectable element if you start your highlighting in a selectable element like my first one, or in a CTRL-A situation. – TetraFlash Oct 11 '13 at 17:42

1 Answers1

1

Use a hidden iframe with the contents of that second div.

Dauh Fhauc
  • 141
  • 11
  • Trying that at the moment but its causing my grief because I cannot clone elements out of the iframe into the first div – TetraFlash Oct 11 '13 at 18:35