拼接html 的事件转义

  attach += "<div style='line-height: 10px;float: left;margin-left: 10px;' id='attach_" + obj.ID + "'>";
        attach += "<div>";
        //attach += "</div>";
        attach += "<p>";
        attach += obj.NAME;
        attach += "</p><p>";
        attach += "<a style='color: #A3A2A2;' href='../../../../Attachment/AddWorkFlow/" + obj.NEWNAME + "' title='' hidefocus='true'>下载</a>&nbsp;";
        attach += "<a style='color: #A3A2A2;' href='javascript:void(0)" + " title='删除附件' hidefocus='true'  onclick='myAddWorkFlow.deleteAttachment("" + obj.ID + "","" + obj.NEWNAME + "")'>删除</a>";
        attach += "</p>";
        attach += "</div>";
        $('#receiveAttachmentList').append(attach);
原文地址:https://www.cnblogs.com/dullbaby/p/3688792.html