<div class="fruit">딸기</div>
<div class="fruit">바나나</div>
<div class="fruit">수박</div>
// const $fruits = $("div.fruit");
// $fruits.css("border", "1px solid blue");
// $fruits.css("padding", "24px");
// $fruits.css("width", "48px");


const fruitEls = document.querySelectorAll("div.fruit");
fruitEls.forEach((el) => {
  el.style.border = "1px solid blue";
  el.style.padding = "24px";
  el.style.width = "48px";
})

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js