0
id 속성을 사용하지 않고 현재 태그를 DOM 요소로 선택할 수있는 방법이 있습니까?riotjs에서 DOM 요소로 현재 태그를 선택하는 방법
현재 수행중인 작업은 다음과 같습니다.
function addAttr(n,v){
var ta = document.getElementById(opts.id);
ta.setAttribute(n,v);
}
나는 이와 같은 직접적인 방법을 찾고 있습니다. document.querySelector jQuery로하지만,하지와 this.root
작품을 전달
function addAttr(n,v){
var ta = document.querySelector(this);
//var ta = document.querySelector(this.root);
ta.setAttribute(n,v);
}
()