HTML DOM select() ·½·¨

¶¨ÒåºÍÓ÷¨

select() ·½·¨ÓÃÓÚÑ¡Ôñ¸ÃÔªËØÖеÄÎı¾¡£

Óï·¨

textareaObject.select()

ʵÀý

ÏÂÃæµÄÀý×Ó¿ÉÑ¡ÔñÎı¾¿òÖеÄÎı¾£º

<html>
<head>
<script type="text/javascript">
function selText()
  {
  document.getElementById("txt1").select()
  }
</script>
</head>
<body>

<textarea id="txt1">Hello world....</textarea>
<input type="button" value="Select text" onclick="selText()">

</body>
</html>
VUE