pusur333
pusur333

Reputation: 49

Input value automatic submit in search box

I have a table which i have made searchable from a JavaScript. I have set the input valute to Stavanger, but when the page load i need to go to the input field and push enter on my keyboard to execute it.

How can the Stavanger value automaticly be executed when loading the page?

Here are an example to see my problem: https://fiddle.jshell.net/Lpn98e8f/

Regards

Upvotes: 1

Views: 35

Answers (1)

Ajay Narain Mathur
Ajay Narain Mathur

Reputation: 5466

You may trigger keyup event using jQuery's trigger function:

Example:

$("#search").trigger("keyup")

Updated fiddle

Upvotes: 1

Related Questions