Skip to content

Latest commit

 

History

History
10 lines (8 loc) · 179 Bytes

slectec-text-of-textarea-automatically.md

File metadata and controls

10 lines (8 loc) · 179 Bytes

自动选中输入文本框的内容

假定 表示文本区域元素: ele

ele.addEventListener('focus', function (e) {
  // Select the text
  e.target.select()
})