By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,243 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

How to select the first line in textarea?

P: n/a
Hi,
Anyone how could I select the first line in the <textareaafter page
load?
I have done after clicking on the textarea, but this isn't good I must
have after load :(

bye
Jan 27 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Jan 27, 1:52*pm, laziers <lazi...@gmail.comwrote:
Hi,
Anyone how could I select the first line in the <textareaafter page
load?
I have done after clicking on the textarea, but this isn't good I must
have after load :(

bye
How did you do it by clicking?

Just do the same thing, except instead of onclick, do
onload="whatEverYouWerDoingBefore()"

But what will be in the textarea when the page loads?
Jan 27 '08 #2

P: n/a
1. <body onload="...">
2.http://www.google.com/search?q=textarea+line+select
ok thats fine, but I cant do this in body :(

Jan 27 '08 #3

P: n/a
On Jan 28, 7:58 am, laziers <lazi...@gmail.comwrote:
1. <body onload="...">
2.http://www.google.com/search?q=textarea+line+select

ok thats fine, but I cant do this in body :(
Do you not have control of the body element directly? If not, perhaps:

window.onload=function()
{
...
}
Jan 27 '08 #4

P: n/a
On 27 Sty, 23:18, "liamge...@gmail.com" <liamge...@gmail.comwrote:
On Jan 28, 7:58 am, laziers <lazi...@gmail.comwrote:
1. <body onload="...">
2.http://www.google.com/search?q=textarea+line+select
ok thats fine, but I cant do this in body :(

Do you not have control of the body element directly? If not, perhaps:

window.onload=function()
{
* * ...

hmm maby this will work, thx
Jan 28 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.