MediaWiki:JSExample.js

$(function {	let template = document.getElementById('JSExample');	if(template == undefined) return;	let htmlText = ` hello!  Textarea:  What you typed:   Button!     let textarea = document.getElementById("textarea");    let txtRepeated = document.getElementById("textarea-repeated");    let button = document.getElementById("button");

textarea.addEventListener("input", function {       txtRepeated.innerHTML = textarea.value;    });

button.addEventListener("click", function {       alert(txtRepeated.innerHTML);    }); `	let body = document.createElement("body") body.innerHTML = htmlText template.appendChild(body) });