To select content or text from form element:
use:
select();
Example:
-
<script>
-
function all_select_content()
-
{
-
document.getElementById(’select_all_content’).select();
-
}
-
</script>
-
<textarea id="select_all_content" rows="5" cols="30">Select content from textarea just click the botton below.</textarea>
-
<input type="button" name="button" value="Select all" onclick="all_select_content()">
-
Demo:
Post a Comment