From 0dedf8ed104c7553097d6f536cd8ae1a460c630e Mon Sep 17 00:00:00 2001 From: soyuka Date: Wed, 16 Oct 2024 15:59:33 +0200 Subject: [PATCH] make examples editable --- js/interactive-examples.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/interactive-examples.js b/js/interactive-examples.js index 321108f74c..0ecb61e2e5 100644 --- a/js/interactive-examples.js +++ b/js/interactive-examples.js @@ -38,6 +38,9 @@ async function main() { const button = document.createElement('button'); const phpcode = example.querySelector('.phpcode'); + const code = phpcode.querySelector('pre code') + code.setAttribute('contentEditable', true) + button.innerText = 'Run code'; button.onclick = function() { if (lastOutput && lastOutput.parentNode) {