mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 14:11:50 +03:00
28 lines
732 B
HTML
28 lines
732 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Button test</title>
|
|
</head>
|
|
<body>
|
|
<script src="mouse-helper.js"></script>
|
|
<button>Click target</button>
|
|
<script>
|
|
window.result = 'Was not clicked';
|
|
window.offsetX = undefined;
|
|
window.offsetY = undefined;
|
|
window.pageX = undefined;
|
|
window.pageY = undefined;
|
|
window.shiftKey = undefined;
|
|
window.pageX = undefined;
|
|
window.pageY = undefined;
|
|
document.querySelector('button').addEventListener('click', e => {
|
|
result = 'Clicked';
|
|
offsetX = e.offsetX;
|
|
offsetY = e.offsetY;
|
|
pageX = e.pageX;
|
|
pageY = e.pageY;
|
|
shiftKey = e.shiftKey;
|
|
}, false);
|
|
</script>
|
|
</body>
|
|
</html> |