javascript - Select all Elements on a page -


i looking function in javascript clicks on every element (links, buttons,...) on page. elements should disabled default. using testing environment in selenium check whether elements on page deactivated.

at first, elements on page:

var elements = document.getelementsbytagname("*"); 

now them, make mouse-event, make loop , apply event on every element:

var clickevent  = document.createevent ('mouseevents'); clickevent.initevent ('click', true, true); (var i=0; < elements.length; i++)  {         elements[i].dispatchevent (clickevent); } 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -