Syntax
::: demo Optional title text
```html
<!-- html code -->
```
```js
// js code
```
```css
/* css code */
```
```json
// config (optional)
{
"jsLib": [
...
],
"cssLib":[
...
]
}
```
::::
Attention
- We use “ShadowDOM” to make style isolation, and we already replace
document
withshadowRoot
. If you want to access the page document, please visitwindow.document
.
Demo
::: demo Demo
<h1>Mr.Hope</h1>
<p>is <span id="very">very</span> handsome</p>
document.querySelector("#very").addEventListener("click", () => {
alert("Very handsome");
});
span {
color: red;
}
:::
Code
::: demo Demo
```html
<h1>Mr.Hope</h1>
<p>is <span id="very">very</span> handsome</p>
```
```js
document.querySelector("#very").addEventListener("click", () => {
alert("Very handsome");
});
```
```css
span {
color: red;
}
```
:::