JSFiddle - React, Tailwind, and code Playground
by Yamini Sontakke
JavaScript
var html='';
var contextObj = {"CategoryID":"1","BillerID":"23","BillerName":"MERCS","RequestType":"QuickPay","AccountNo":"1234567890","Authenticator":"{\"EmailAddress\":\"dfgsdfgsdfg\",\"MobileNumber\":\"65-4576573\",\"ID\":\"4572-4756876-8\"}","Token":"3C639AE65"};
html = getKeyValueJson(contextObj, html);
$('div').html(html);
function getKeyValueJson(obj, html) {
$.each(obj, function (key, value) {
if (value == null) {
return
}
if (typeof value == 'object') {
getKeyValueJson(value, html);
}
else {
html += '<label>' + key + '</label> :- <label>' + value + '</label><br>';
}
});
return html;
}