Comment changer la valeur d'attribut href
d'un tag <a/>
en Javascript sur le bouton click?Comment changer href de <a> tag on button click through javascript
<script type="text/javascript">
function f1()
{
document.getElementById("abc").href="xyz.php";
}
</script>
<a href="" id="abc">jhg</a>
<a href="" id="" onclick="f1()">jhhghj</a>
La Voie d'accessibilité dicte de ne pas utiliser les liens de cette manière. Ici: http://xkr.us/js/links –