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
Post a Comment