选中input里面的内容触发事件
1 回答
已采纳
慕莱坞9220042
TA贡献377条经验 获得超508个赞
你好:
定义和用法
onselect 属性在元素中的文本被选中时触发。
onselect 属性可用于以下元素内:<input type="file">、<input type="password">、<input type="text">、<keygen> 以及 <textarea>.
例子:
<!DOCTYPE html>
<html>
<head>
<script>
function showMsg()
{
alert("您选中了一些文本!");
}
</script>
</head>
<body>
一些文本:<input type="text" value="请选中我!" onselect="showMsg()">
<p>函数 showMsg() 在输入字段中的文本被选中时触发。此函数显示一段消息。</p>
</body>
</html>望采纳!
- 1 回答
- 0 关注
- 1376 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消
