cara binthtml kosong
element.innerHTML.length == 0 ? element.appendChild(createdEl) : (element.innerHTML = '', modalNote.appendChild(createdEl));
CuteKittyCat
element.innerHTML.length == 0 ? element.appendChild(createdEl) : (element.innerHTML = '', modalNote.appendChild(createdEl));
function createElement( str ) {
var frag = document.createDocumentFragment();
var elem = document.createElement('div');
elem.innerHTML = str;
while (elem.childNodes[0]) {
frag.appendChild(elem.childNodes[0]);
}
return frag;
}
document.getElementById("dated").innerHTML = "blah"
document.getElementById("dated").innerHTML = month + "/" + day + "/" + year;
document.getElementsByClassName('buddyName')[3].innerHTML= "Aragorn";