I am struggling to append huge amounts of html code. I found this answer How To Append (Or Other Method) a Lot of HTML Code? which I followed but I am getting an illegal argument error. Can anyone suggest a better way to manage this?
JS
$(function() {
  $("a").click(function() {
    $("body").append(codeBlock);
  });
});
var codeBlock = $("<div class='code-block'>\
    <div class='select-event'>\
        <label>Start</label>\
        <select>\
            <option>when the Run button is pressed</option>\
            <option>when the object is pressed</option>\
            <option data-option='keyoption'>when a keyboard key is pressed</option>\
        </select>\
        <span class='key-press-wrapper'>\
            <label>Key</label>\
            <input id='keyPress' placeholder='Press Key'>\
        </span>\
    </div>\
    <div class='insert-block'>\
        <label>Insert code blocks here</label>\
        <ul id='sortable' class='connectedSortable'></ul>\
    </div>\
</div>\");
 
     
     
     
    