1. 自动选中区域内容

<html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>自动选择文本框/编辑框中的文字</title>
<script type="text/javascript">
    function Myselect_txt(){
        if (document.form1.title.focus){
        document.form1.title.select();}
    }
    function Myselect_txtarea(){
        if (document.form1.content.focus){
        document.form1.content.select();}
    }
</script>


<form name="form1">
    <input name="title" type="text" size="50" value="今日新闻头条" onClick="Myselect_txt()">
    <textarea name="content" cols="50" rows="6" onClick="Myselect_txtarea()">今日,据相关方面报道,...</textarea>
 </form>

</html>

 参考(先占位,后面再补充):https://blog.csdn.net/mafan121/article/details/78519348

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2021-12-17
  • 2021-12-28
  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
猜你喜欢
  • 2021-09-26
  • 2021-09-28
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2021-10-08
  • 2022-02-14
相关资源
相似解决方案