Created
September 7, 2018 00:09
-
-
Save malikkurosaki/cd3bcd59177f5c5fdd27e9a5f2ec05b5 to your computer and use it in GitHub Desktop.
javascript prototype manipulation object
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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