get href attribute javascript
document.getElementById("link")[0].getAttribute("href");
get href attribute javascript
document.getElementById("link")[0].getAttribute("href");
check href javascript
// CHECK HREF
const navLinks = document.querySelector(".nav_link");
const navLink = navLinks.getAttribute("href");
const browserHref = window.location.href; // browserHref.search(navLink)
function sliceLink() {
if (browserHref.includes(navLink)) {
let searchLink = browserHref.search(navLink); // get position
let slicedString = browserHref.slice(searchLink); // result
return slicedString;
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us