indexing - How to get index value of a link with a specific class using plain JavaScript? -
I have about 20 links with the specific category of links that I want to target if 10th link is clicked So, how can I get its indicative value (I need to return)?
I am using plain javascript so that there is no jQuery.
Through the loop elements, click
function link ( L) {var elements = document.getElementsByClassName ('className'); For (var i = 0; i & lt; elements.length; i ++) {if (element [i] == el) {warning (i); // Element Pointer}}}
Comments
Post a Comment