Answer the question
In order to leave comments, you need to log in
Error .getAttribute is not a function, I don't understand why?
<tab-panel>
<div data-tabname="one">Tab one</div>
<div data-tabname="two">Tab two</div>
<div data-tabname="three">Tab three</div>
</tab-panel>
<script>
function asTabs(node) {
let nArr = Array.from(node.childNodes);
nArr.map(node => {
console.log(node.getAttribute("data-tabname");
//далее другие манипуляции
});
};
asTabs(document.querySelector("tab-panel"));
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question