Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How implement I'm feeling Lucky in html?

Tags:

html

forms

I have been trying to implement a form that goes to either normal Google search results or it's first search result. This is what I have tried.

<form action="https://google.com/search">
    <input type="text" name="q" class="box">
    <br>
    <div>
        <input type="submit" value="Google Search" class="button">
        <input type="submit" value="I'm Feeling Lucky" class="button" formaction="https://google.com/search?&btnI=1">
    </div>
</form>

I know for a fact that if I search for let's say "AMD" then the I'm feeling lucky URL should be "https://google.com/search?q=AMD&btnI=1"

However, I am not able to add that "&btn1" at the end of the URL.

like image 854
Kruti Deepan Panda Avatar asked Jul 13 '20 04:07

Kruti Deepan Panda


Video Answer


1 Answers

It will work fine.

<form action="https://google.com/search">
    <input type="text" name="q" class="box">
    <br>
    <div>
        <input type="submit" name="btnK" value="Google Search" class="button">
        <input type="submit" name="btnI" value="I am Feeling Lucky" class="button">
    </div>
</form>
like image 83
Omar Sheashaa Avatar answered Oct 02 '22 12:10

Omar Sheashaa