Set focus to text field - SOLVED

edited June 8 in Stylish Firefox

Hi.

I'm very new using this extension.
So, sorry if my questions seems so simple.

I'm trying to set focus to a text text field.
Site is to download videos from Facebook.
Problem is that every time I go there, focus is not on text field and I have to use mouse to input URL data to download the video.
Site is:
https://www.fbdown.net/

Inspecting element, tags and variables involved are:
input name="URLz" class="form-control input-lg" placeholder="Enter Facebook Video Link ..." type="text"

but I don't know how to write the code.

Is there a way to set Stylish to put focus on that text field?

Thanks

Comments

  • Not possible with CSS only.
    You'll need to use javascript for this.
  • For inserting custom JavaScript to sites (UserScripts), use another extension like tampermonkey

  • I apreaciate your suggestions, qlk and stonecrusher.

    For inserting custom JavaScript to sites (UserScripts), use another extension like tampermonkey

    About this, I have already installed Greasymonkey. Is it a similar tool?
    If so, may you point me some tips to how to do that?
    I do not master JavaScript, but I guess that so basic task like InputFocus is not so hard to write.

    TIA
  • document.querySelector('.form-control[name="URLz"]').focus();
  • document.querySelector('.form-control[name="URLz"]').focus();

    Your solution worked very well, anagrammar!
    Many thanks.
    :) :) :)
Sign In or Register to comment.