Skip to content

Commit 6f61122

Browse files
📚 Update
1 parent b582c3d commit 6f61122

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,18 @@ HTMLCodeBlockElement.highlight = function (src, options) {
172172
// 3. Define
173173
customElements.define('code-block', HTMLCodeBlockElement);
174174

175-
// 4. Use
175+
// 4. Make
176176
const cbElm = new HTMLCodeBlockElement();
177+
178+
// 5. Assign
179+
cbElm.language = 'javascript';
180+
cbElm.label = 'your label';
181+
cbElm.value = `const hoge = true;
182+
183+
console.log(hoge);`;
184+
185+
// 6. Append
186+
document.body.append(cbElm); // Render at the same time
177187
```
178188
179189
##### Syntax

0 commit comments

Comments
 (0)