This line of code is not working, how can I create a DOM element and adding it a class instantly?
JavaScript
x
2
1
var notes = document.createElement("div").addClass("notes card-content");
2
Advertisement
Answer
You could use just jQuery for this :
JavaScript
1
2
1
$("<div/>").addClass("notes card-content");
2
Hope this helps.