HTMLCodeBlockElement

Code block custom element with syntax highlighting and copy button.

It is recommended that the following CSS be loaded for before JavaScript works

With escaped text

Source

Result

<script>console.log(true);</script>

With the textarea element

Source

Note: The textarea element cannot be included in the content of the textarea element. If you want to include it, please use HTML Entity for the tag.

Result

Playground

// this is placeholder (code-block#cb)

Let's paste these in conosole to run JS on this page.