私の先生がコードを 以下に変更しましたが、動作しません。どのように動作して解決するのか理解できません。setAttributeのJavascript
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私はそれを修正して良いです! –
@guntars:あなたはsmarxの答えを受け入れるべきです。 –