Skip to content

Instantly share code, notes, and snippets.

@malikkurosaki
Created September 7, 2018 00:09
Show Gist options
  • Save malikkurosaki/cd3bcd59177f5c5fdd27e9a5f2ec05b5 to your computer and use it in GitHub Desktop.
Save malikkurosaki/cd3bcd59177f5c5fdd27e9a5f2ec05b5 to your computer and use it in GitHub Desktop.
javascript prototype manipulation object
function buatElement(dataElement,panggil){
var ini = {};
for(i in dataElement){
var b = document.createElement(dataElement[i].jenis);
b.id = dataElement[i].id;
malikFrame.appendChild(b);
ini[dataElement[i].id] = malikFrame.getElementById(dataElement[i].id)
if(dataElement[i].icon != undefined){
b.className = dataElement[i].icon
}
if(dataElement[i].image != undefined){
b.src = dataElement[i].image;
}
}
panggil(ini)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment