QUESQU'Y MARCHE PAS AVEC MON CODE, ENCORE?
JavaScript:
class HTML {
constructor() {
this.Element = null;
}
create(type = '', style = '', innerHTML = '', placeholder = '') {
this.Element = document.createElement(type);
this.Element.style = style;
this.Element.innerHTML = innerHTML;
this.Element.placeholder = placeholder;
return this.Element;
}
onHover(parameters) {
this.Element.addEventListener("mouseover", function () {
parameters;
});
}
}
var Element1 = new HTML;
Element1.onHover(function () { alert(''); });
document.body.appendChild(Element1.create('p', '', 'This is a text'));