my html is like this:
<button onclick="prints(this.nextElementSibling.attributes)">me!</button>
<a href="project/webdev/convert.js"> convert! </a>
the prints function just outputs the function parameters onto console log. I need to find the href value of the a tag immediately beside the anchor tag. i.e on clicking the button, I need to get the value "project/webdev/convert.js"
The "this.nextElementSibling.href" gives me "http://127.0.0.1:8080/project/webdev/convert.js". Is there anyway I can instead get the relative address? i.e project/webdev/convert.js.
Anyhelp would be very much appreciated.(I cannot use Jquery, I want to do this with vanilla javascript)