mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-15 06:02:57 +03:00
43 lines
881 B
HTML
43 lines
881 B
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Selection Test</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<label for="agree">Remember Me</label>
|
||
|
<input id="agree" type="checkbox">
|
||
|
<script>
|
||
|
window.result = {
|
||
|
check: null,
|
||
|
events: [],
|
||
|
};
|
||
|
|
||
|
let checkbox = document.querySelector('input');
|
||
|
|
||
|
const events = [
|
||
|
'change',
|
||
|
'click',
|
||
|
'dblclick',
|
||
|
'input',
|
||
|
'mousedown',
|
||
|
'mouseenter',
|
||
|
'mouseleave',
|
||
|
'mousemove',
|
||
|
'mouseout',
|
||
|
'mouseover',
|
||
|
'mouseup',
|
||
|
];
|
||
|
|
||
|
for (let event of events) {
|
||
|
checkbox.addEventListener(event, () => {
|
||
|
if (['change', 'click', 'dblclick', 'input'].includes(event) === true) {
|
||
|
result.check = checkbox.checked;
|
||
|
}
|
||
|
|
||
|
result.events.push(event);
|
||
|
}, false);
|
||
|
}
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|