Snippet url

export const getUrlParams = (element) => { const URL_PARAMS = window.location.search; const $URL_NAVLINKS = document.querySelectorAll(element); if(URL_PARAMS) { [...$URL_NAVLINKS].forEach(el => { if(el.href.indexOf(URL_PARAMS) < 0 ) el.href += URL_PARAMS; }); } };

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.