I have some plugin-generated html that I can't change, and need to add an id to an <a>
tag so that I can change it's href
link.
HTML
<div id="wpmem_login">
<form action="www.staging.com/login" method="POST" class="form">
<fieldset>
<!--other html fields-->
<div align="right" class="link-text">
<a href="www.staging.com/password_reset"> click to reset password</a>
</div>
<div align="right" class="link-text">
<a href="www.staging.com/register"> click to register</a>
</fieldset>
</form>
</div>
(this code is form generated so I had to type from looking at inspect element, so there are more html fields above these two where I commented and any typos there may be really aren't relevant)
I need to change the href link on the second to last field, password reset, without touching the last link that has identical classes. I know I can do this with $("#reset").attr("href", "http://www.staging.com/pwd_reset")
once I have an id or selector #reset
on that div, but I'm not sure how to get that selector.
I need help adding an id or getting the .attr
function to the right link.