如何实现打开网页时使网页里搜索文本框中的字自动选中!

来源:百度知道 编辑:UC知道 时间:2024/06/01 22:14:36
ASP程序

<input type="text" name="ttt" onmouseover="this.select()" value="文本"/>

给你一个鼠标移上就选中的代码

<label> <input name="searchInput" type="text" id="searchInput" value="This is Init Value." /> </label>

<script type="text/javascript">

document.getElementById("searchInput").select();

</script>