# Javascript:focus and select

**URL:** <https://forum.kirupa.com/t/javascript-focus-and-select/233993>\
**Category:** Uncategorized\
**Created:** [July 29, 2007, 8:53am UTC](https://forum.kirupa.com/t/javascript-focus-and-select/233993 "2007-07-29T08:53:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Evael](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/evael/32/2603_2.png) [@Evael](https://forum.kirupa.com/u/Evael)\
**Post date:** [July 29, 2007, 8:53am UTC](https://forum.kirupa.com/t/javascript-focus-and-select/233993/1 "2007-07-29T08:53:30Z")

</div>

\<head\>  
\<body\>  
\<td width=“346”\>\<table width=“346” border=“0” cellpadding=“0” cellspacing=“0”\>  
\<tr\>  
\<td width=“63” height=“5” valign=“top” class=“myWebEmbedNURLFont”\>&nbsp;&nbsp;URL\</td\>  
\<td id=“urlForm” width=“283” align=“left” valign=“top”\>\<input name=“embedCode” type=“text” value=“testingtestingtestingtestingtestingtestingtestingtestingtestingtestingtesti  
ngtesting” class=“myWebEmbedNURLInputFont” size=“47” onClick=“java script:document.urlForm.embedCode.focus();document.urlForm.embedCode.select();” readonly=“true”\>\</td\>  
\</tr\>  
\</td\>  
\</body\>

a very draft code, what i wanna do is when i click on the form, the value will auto be selected. but i cant seem to do so, and i am not very sure of the problem. can someone kindly point out to me? thanks.
