Friday, 15 May 2015

javascript - jQuery dialog text selected like js prompt? -



javascript - jQuery dialog text selected like js prompt? -

hey quick question!

i want have text selected in dialog window user can press ctrl + c re-create text. can done , if can, how?

an illustration of javascript alert prompt. there user can u press ctrl + c re-create text. anyway implement in jquery dialog div?

thanks peeps!

i utilize jquery ui dialog widget this, http://api.jqueryui.com/dialog/. highlight text need utilize plugin mentioned here, highlight word jquery.

if ok using textarea within dialog, seek this.

<div><button id="opener">open dialog</button> <div id="dialog" title="dialog title"><textarea id="test">i'm textarea within dialog</textarea></div> </div> <script type="text/javascript"> <!-- $(document).ready(function() { $( "#dialog" ).dialog({ autoopen: false }); $( "#opener" ).click(function() { $( "#dialog" ).dialog("open"); $( "#dialog textarea" ).select(); }); }); //--> </script>

javascript jquery asp.net-mvc

No comments:

Post a Comment