I am learning JavaScript and I saw a video about creating tabs using HTML, CSS, and JavaScript. But I am not understanding how the code is working. This is a codepen of the code: Tabs Codepen by WebDevSimplified. To be more specific I am not understanding what the value of target
will be in this line const target = document.querySelector(tab.dataset.tabTarget);
. Is it taking the values #home
, #pricing
and #about
from data-tab-target
and applying the class active on the specific data-tab-content
based on which data-tab-target
the user clicks on?