!!! Listings zum Artikel "Kompetente Puzzleteile" !!! von Philip Ackermann in iX 1/2015, S. 142 !!! Listing 1 @ü.li:Listing 1:Custom Elements @li:var prototype = Object.create(HTMLInputElement.prototype); prototype.createdCallback = function() { this.type = "checkbox"; this.addEventListener("change", this.showAlert); }; prototype.showAlert = function(){ alert('selected'); }; var AlertCheckbox = document.registerElement("alert-checkbox", { prototype: prototype, extends: 'input' }); document.body.appendChild(new AlertCheckbox()); !!! Listing 2 @ü.li:Listing 2:Erzeugen eines Shadow DOM @li: