Attribute value is automatically inserted inside double quote

Keywords´╝Ü javascript html dom

Question: 

I want to place html node as I have created. But when using JS and inserting inside div it single quotes changes to double quotes. Code is :

function createHederaObject(params){
    let Hederaobject =  '<hedera-micropayment '
        for(var i in params){
            if(params.hasOwnProperty(i) && i!=='attrID'){
                Hederaobject += i +"= '"+ params[i] + "' , " + "\n";
            }
        }

        Hederaobject += '></hedera-micropayment>';
        console.log(Hederaobject);

        var body = document.getElementById(params['attrID']);
        body.innerHTML += Hederaobject;
        //console.log((Hederaobject))
        return Hederaobject;
        //callback(Hederaobject);
    }

I should be exactly like this:

     <hedera-micropayment submissionnode= '0.0.1761' ,
        time= '1559313345' ,
        type= 'article' ,
        memo= '1275,79' ,
        paymentserver= 'http://localhost:9090/' ,
        recipientlist= '[{ "to": "0.0.99", "tinybars": "4666667" }]' ,
        contentid= '79' ,
        extensionid= 'ligpaondaabclfigagcifobaelemiena' ,
        redirect= '{ "nonPayingAccount": "/insufficient-amount/", "noAccount": "/account-not-paired/", "homePage": "/" }' ,></hederamicropayment>

But all the single quotes gets replace and become like this:

    <hedera-micropayment data-submissionnode="0.0.1761" ,="" data-time="1559313345" data-type="article" data-memo="1275,79" data-paymentserver="http://localhost:9090/" data-recipientlist="[{ &quot;to&quot;: &quot;0.0.99&quot;, &quot;tinybars&quot;: &quot;4666667&quot; }]" data-contentid="79" data-extensionid="ligpaondaabclfigagcifobaelemiena" data-redirect="{ &quot;nonPayingAccount&quot;: &quot;/insufficient-amount/&quot;, &quot;noAccount&quot;: &quot;/account-not-paired/&quot;, &quot;homePage&quot;: &quot;/&quot; }"></hedera-micropayment>

which created the problem while parsing data. In this particular one

  data-recipientlist= '[{ "to": "0.0.99", "tinybars": "4666667" }]' ,

I must have same structure.

How to keep the single quotes as it is. Any ideas ? Thanks

Answers: