Written by
java-style
on
on
[JS] dataset
[JS] dataset
자바스크립트로 개발자만 볼 수 있게 html에 data를 심을 수 있다.
Products Information Shipping
data-'작명' = '값'
위 형식으로 작성하면 되고 해당 요소를 꺼내기 위해서는 아래와 같이 입력하면 된다.
//JS document.querySeletor('.tab-button').dataset.id //0 //jQuery $(".list").click(function (e) { tabOpen(e.target.dataset.id); });
from http://codingbucks.tistory.com/127 by ccl(A) rewrite - 2021-11-22 18:01:44