UNPKG

slimerjs-firefox

Version:

This repo includes slimerjs as well as downloads a local copy of Firefox.

32 lines (31 loc) 986 B
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>calbback and click - issue</title> <style type="text/css"> #btn { width:100px; height:100px; position: absolute; top:20px; left:20px; border:1px solid red; } </style> </head> <body> <button id="btn">a button</button> <div id="bla"></div> <script> function launchClick() { window.callPhantom({'sendEvent': ['click', 25, 25], 'html':''}); //setTimeout(function() { window.callPhantom({'html': document.getElementById('bla').innerHTML, 'sendEvent':null}); //},250); } document.getElementById("btn").addEventListener("click", function(event) { document.getElementById('bla').innerHTML = "button clicked"; }, false); </script> </body> </html>