jquery - paragraph Select() doesn't work in javascript -
here html code
<div id="dialog" title="basic dialog" style="display: none"> <p id="para">copy key</p> <p id="key">4567887654345678</p> </div> <button>open dialog</button>
the div appears dialog on button click, , have
"key" text selected when dialog opens
here javascript same, < p> doesn't appear selected
$(function() { $( "button" ).click(function() { $("#dialog" ).dialog(); $( "#dialog" ).show( "slow" ); $("#key").select(); }); });
how can make < p> pre-selected ?
change key
paragraph editable element, such textarea:
<textarea id="key">4567887654345678</textarea>
it appears need editable text field select text in.
Comments
Post a Comment