[英]highlight and select a text of a input with jQuery
我無法在stackoverflow中找到解決方案。 我有一個輸入字段和一個值。 我希望選擇並突出顯示該值,以便用戶可以輕松復制文本。 我怎么能用jQuery做到這一點?
<input value="copy this text easily" />
使用jQuery,您可以使用select
函數:
$("input").select();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.