有html代码:
<input type="text">
我需要拒绝在<input>
答案 0 :(得分:2)
由于user-select: none
无法为输入工作,您可以这样解决:
.invisable-selection::selection {
background: transparent;
}
&#13;
<input class="invisable-selection" type="text" value="test" oncopy="return false">
&#13;
它不会显示选择,也不会复制该值。
答案 1 :(得分:-2)
您可以尝试,它不会影响任何主要的样式更改,
<input type="text" value="john" readonly>
&#13;