in this stackoverflow answer I've found how to make text unselectable, which works as expected when used inside a div and stuff. However i can not get it to work inside an iframe.
here is a jsFiddle showing my problem, the text inside the div with the unselectable
class is indeed unselectable as expected, but the lorem ipsum on the website is still selectable, despite having the same unselectable
class
Is this because elements inside iframe
do not inherit the classes like <p>
does inside <div>
?
If that is the case is there a way to make any text inside the iframe unselectable (html/css/javascript)? Or can this only be done from the source code of the page displayed inside the iframe?
setting pointer-events: none
is not an option either since buttons and stuff should still be interactable
Thank you for your time.
-Remy
Edit: Thanks for pointing me to this topic, this does indeed also work for disabling selecting.