回答受付が終了しました
jqueryで書いていたものをjsで書き直したかったのですが、タグもそのまま文字列で出力されてしまいます。 何が足りないのか教えてください。 ・jquery
jqueryで書いていたものをjsで書き直したかったのですが、タグもそのまま文字列で出力されてしまいます。 何が足りないのか教えてください。 ・jquery $(function () { const $targetElement = $('.js-ibunaisi'); const HtmlDoc = ` <h3>xxxxx</h3> <p>xxxxxxx</p> `; $targetElement.append(HtmlDoc); }); ・js $(function () { const targetElement = document.querySelector('.js-ibunaisi'); const HtmlDoc = ` <h3>xxxxx</h3> <p>xxxxxxx</p> `; targetElement.append(HtmlDoc); });
JavaScript | プログラミング・68閲覧