[jquery] appendを使用して複雑にネストされたDOMを追加する方法
jqueryのappendを使用して複雑にネストされたDOMを追加する方法は以下の通り
id がcontainerに複雑にネストされたDOMを追加する
var nestedDom = ""; nestedDom += "\ <div class='wrap'>\n\ <img src='https://hogehoge.info/image.jpg' class='iconimg' />\n\ <div class='result_text'>DOMなどのテキスト</div>\n\ <button type='button' class='bun' value='1'>ボタン</button>\n\ </div>"; $("#container").append(nestedDom);