daily pastebin goal
38%
SHARE
TWEET

Untitled

a guest Jan 22nd, 2018 109 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <a href="home" id="relurl" target="_blank" title="This is a relative link!">link</a>
  2.    
  3. var x = window.location.href; // Current page URL
  4. var link = document.getElementById("relurl"); // store the element
  5. var curHref = link.getAttribute('href'); // Get HREF paramter
  6. link.setAttribute('href', x + "/"+ curHref);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top