您的位置:首页 > 其它

文本框获得焦点时选中文本框中的文字

2017-11-21 13:44 190 查看
<!doctype html>

<html>

<head>

<!--文本框获得焦点时选中文本框中的文字-->

<style>

</style>

<script>

function test(){
var test=document.getElementById("test");
test.select();//选中框中的所有文本;

}
</script>

<meta charset="UTF-8">

</head>

<body>

<input type="text" value="xisix" id="test" onfocus="test()">
</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐