mirror of
https://github.com/microsoft/playwright.git
synced 2024-11-29 01:53:54 +03:00
29 lines
562 B
HTML
29 lines
562 B
HTML
<html>
|
|
<head>
|
|
<script>
|
|
customElements.define('my-link',
|
|
class extends HTMLElement {
|
|
constructor() {
|
|
super();
|
|
|
|
const template = document.getElementById('my-link-template');
|
|
const templateContent = template.content;
|
|
|
|
this.attachShadow({mode: 'open'}).appendChild(
|
|
templateContent.cloneNode(true)
|
|
);
|
|
}
|
|
}
|
|
);
|
|
|
|
window.clickCount = 0;
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<template id="my-link-template">
|
|
<a href="#" id="inner-link" onclick="clickCount++"><slot></slot></a>
|
|
</template>
|
|
<my-link>Sign up</my-link>
|
|
</body>
|
|
</html>
|