Diskussionen » Entwicklung

How to make a greasemonkey script to automatically set seacrh field value to particular value?

§
Veröffentlicht: 13.01.2016

How to make a greasemonkey script to automatically set seacrh field value to particular value?

This is my code, which is not working:

var id=document.getElementById["thesearchbox"].value;

if(id==="") {

if(confirm("wanna search for fifa 16 crack?"))
{
    document.getElementById["thesearchbox"].value="fifa 16 crack";
}

}

Here thesearchbox is the id of search field.

§
Veröffentlicht: 14.01.2016

replace ["thesearchbox"] by ("thesearchbox")

§
Veröffentlicht: 14.01.2016

thanks it worked.

Antwort schreiben

Anmelden um eine Antwort zu senden.