사용자 정의 태그와 함께 작동하지 않습니다와 나는 자바 스크립트를 통해
<ul>
태그에
<li>
를 추가 할 :
document.getElementById를 내가 Google 크롬 확장 프로그램을 개발하고 있어요
var newLI = document.createElement("LI");
var ul = document.getElementById('tag_list');
ul.appendChild(newLI);
newLI.innerHTML = "<a href=\"dddaaaa\">" + json + "</a>";
및 HTML :
<template id="box#add-feeds">
<ul class="search-ac" id="tag_list" name="tag_list"></ul>
</template>
을
<template>
태그를 제거하면이 코드는 잘 작동하지만이 태그를 사용하면이 오류가 발생합니다.
Cannot call method 'appendChild' of null
자바 스크립트 코드를 변경해야하므로 템플릿 태그를 제거 할 수 없습니다. 태그가 맞춤 태그에있는 경우 getElementById
이 작동하지 않는 이유에 대한 아이디어 <template>
?