logo
努力加载中 ……

Normal Code Demo

原创shentuzhigang9/25/2022, 1:00:16 PM118几秒

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 with shadowRoot. If you want to access the page document, please visit window.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;
}
```

:::