触发 onselect
属性事件在一个元素中选择文本后。
没有。
<elementName onselect="script">
<input type="file">, <input type="password">, <input type="text">, <keygen>, <textarea>
onselect |
Yes | Yes | Yes | Yes | Yes |
<!DOCTYPE html>
<html>
<body>
Some text: <input type="text" value="Select me!!" onselect="myFunction()">
<script>
function myFunction() {
console.log("You have selected some text!");
}
</script>
</body>
</html>