클래스에 innerHTML 로 html 코드 추가하기
HTML,CSS,JAVASCRIPT

클래스에 innerHTML 로 html 코드 추가하기

var selectedItem = document.getElementsByClassName("app"); 
for (var i = 0; i < selectedItem.length; i++) {
    selectedItem[i].innerHTML = `
    <h1>Hello Vanilla!</h1>
    <div>
      We use the same configuration as Parcel to bundle this sandbox, you can find more
      info about Parcel 
      <a href="https://parceljs.org" target="_blank" rel="noopener noreferrer">here</a>.
    </div>
    `;
}

 


var selectedItem = document.getElementsByClassName("app"); 

for (var i = 0; i < selectedItem.length; i++) {
    selectedItem[i].innerHTML = `
    <h1>Hello Vanilla!</h1>
    <div>
      We use the same configuration as Parcel to bundle this sandbox, you can find more
      info about Parcel 
      <a href="https://parceljs.org" target="_blank" rel="noopener noreferrer">here</a>.
    </div>
    `;

}