pusur333 pusur333 - 8 days ago 6
HTML Question

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

A.J A.J
Answer

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

Example:

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

Updated fiddle