PageSourceSearch

https://www.enbrel.com/-/media/Themes/Amgen/Enbrel-com/Enbrel-com/Scripts/Custom-Scripts/activeClass.js

js enbrel.com collected 2026-09-24 19:50:32 UTC 837 bytes, 17 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function() {
2    const currentPath = window.location.pathname.replace(/^\//, '');
3    // Select all nav links (both main menu and sub-menu)
4    const navLinks = document.querySelectorAll('.jumplink a');
5    navLinks.forEach(link => {
6        // Get the href attribute and clean it up (remove leading slashes and the .html extension if necessary)
7        const href = link.getAttribute('href').replace(/^\/+/, '').replace(/\.html$/, '');
8        // Compare the link's href with the current path
9        if (href === currentPath) {          
10            // Add the 'active' class to the parent <li> element
11            const parentLi = link.closest('.jumplink a');
12            if (parentLi) {
13                parentLi.classList.add('active');
14            }
15        }
16    });
17})

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.