Answer the question
In order to leave comments, you need to log in
How to make js return href inside id?
Here is a piece of code, how to refer to href? you need to find it and replace it with js methods.
Please, help!
Tried GetElementById - doesn't help!
Example:
<li id="l_pr" class="">
<a href="/id200986" onclick="return nav.go(this, event, {noback: true, params: {_ref: 'left_nav'}});" class="left_row">
</li>
Answer the question
In order to leave comments, you need to log in
<a href='url' id='myId'>link</a>
var el = document.querySelector('#myId');
var href = el.getAttribute('href'); //получить href вашей ссылки
el.setAttribute('href', 'newurl'); //установить новый href
An example is here:
<li id="l_pr" class="">
<a href="/id20026986" onclick="return nav.go(this, event, {noback: true, params: {_ref: 'left_nav'}});" class="left_row">
</li>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question