How To Use The Internet For Your Business
Works In Any Industry. Guaranteed.
Get your FREE Tutorial at www.PinoyBizNow.com

HTML Forms and Instant Select

If you’re wondering how people create windows which contain text that gets automatically selected or highlighted when someone clicks inside the window, here’s the HTML code:

<textarea name="nameofyourtextarea" rows="4" cols="100" 
readonly="readonly" id="idofyourtextarea" 
class="cssforyourtextarea" onfocus="this.select()" 
style="height:150px;width:300px;">
Your long text (contents of your textarea box)...
</textarea>

And there you go…

The key there is the part that says onfocus=”this.select()”

Have fun!

No related posts.

Share on Facebook

First posted on Sunday, 04 Jan 2009

Tags:

« « Dayo: Animated Philippine Culture| Blog Contest: Win a Book » »

Trackback URI | Comments RSS

Leave a Reply