Stringify nested JSON object

This commit is contained in:
Lei Wang 2020-03-26 18:45:57 -07:00
parent d84a86897c
commit 022aeac808

View File

@ -215,7 +215,11 @@
const content = document.createElement('div');
content.classList.add("content");
content.innerHTML = element[prop];
if (typeof (element[prop]) === "object") {
content.innerHTML = JSON.stringify(element[prop]);
} else {
content.innerHTML = element[prop];
}
field.appendChild(attribute);
field.appendChild(content);