Skip to content

Commit

Permalink
make examples editable
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Oct 16, 2024
1 parent 51dbc7b commit 0dedf8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions js/interactive-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 0dedf8e

Please sign in to comment.