文本框得到焦点和选中其中内容

得到焦点:element.focus();

选中其中内容:element.select();

得到焦点时选中内容:<element onfocus="this.select();" />

原文地址:https://www.cnblogs.com/lbnnbs/p/4781932.html