On Wed, Dec 23, 2009 at 4:53 PM, Ahmed <[email protected]> wrote:
> I was trying to alter a text area's value from empty into "Type here"
> where the web page is not part of the extension (say Google.com and
> "Text Here" appears in the text box).
>
> This is my content script:
>
> document.getElementsByName('q').value = "vvvvvvvvvvvvvvv";
>
> --- thats it, where q is the name of the google text box.
Hey Ahmed, "getElementsByName" returns a list rather than a single
element, so you could rewrite that line as:
document.getElementsByName('q')[0].value = 'Type here';
(0 might not be the proper index.)
--
You received this message because you are subscribed to the Google Groups
"Chromium-extensions" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/chromium-extensions?hl=en.