1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 文本框获得焦点时选中文本框中的文字

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

时间:2021-09-10 01:29:35

相关推荐

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

<!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" οnfοcus="test()">

</body>

</html>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。