In der Schule mein Lehrer änderte meinen Code zu Beispiel unten und es funktioniert nicht und ich kann nicht verstehen, wie es funktioniert und es beheben.Javascript für in SetAttribute
function _$(e, attrs) {
var el = document.createElement(e);
for(a in attrs){
el.setAttribute(a, attrs[a]);
}
}
var $taskMain = _$("section", { "class": "sdfjsf", "id": "taskId", "data-id-number": "sajfsaf"});
//and i have error
//template.js:80 Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
currentCollon.appendChild($taskMain);
thx ich repariere es und es ist gut !!! –
@guntars: Dann sollten Sie die Antwort von Smarx akzeptieren. –