There is html-code:
<input type="text">
I need to deny selecting text in <input>
There is html-code:
<input type="text">
I need to deny selecting text in <input>
Since user-select: none
won't work for an input, you could solve it like this:
.invisable-selection::selection {
background: transparent;
}
<input class="invisable-selection" type="text" value="test" oncopy="return false">
It won't show the selection and it won't copy the value.
You may try like, it's not affect any major style changes,
<input type="text" value="john" readonly>
for mozilla: use css:
input { -moz-user-select: none; }
for other: use js
$('input').bind('mousemove', function (e) { e.preventDefault(); }); – Михаил Поправко Apr 11 '17 at 07:13