日期:2014-05-16  浏览次数:20464 次

JS 小技巧:载页面的时候自动选择一端文字,方便用户


<script type="text/javascript">
window.onload = function(){
  var text_input = document.getElementById ('myTextInput');
  text_input.focus ();
  text_input.select ();
}
</script>

self-explanatory 不解释了