javascript - How to make something clicked after a few seconds? -


I am trying to do something, after 5 seconds of loading the page, what will happen as clicked Was there. I'm trying to click the button's ID openSidebar . Here I have what, but I do not know how to fill the function.

  Click the function OpenSidebar () {setTimeout (function () {}, 5000); } Onload = "Click the Open Sidebar;"    

You can click on click on the element to fire a click < / Code>.

Code:

  var foo = document.getElementById ("OpenSidebar"); Foo.addEventListener ("click", function () {warning ('click');}, false); Click the function OpenSidebar () {setTimeout (function () {document.getElementById ('openSidebar'). Click ();}, 5000); } Click on OpenSidebar ();  

Demo:


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -