I want to affect a variable containing url to a css button’s href attribute i tried location.href but it didn’t work .
here’s my button description :
<div>
<p><a id="gameNextLevel" class="button" href="">Next</a></p>
</div>
Here’s my JSF related code :
var uiNextLevel = $("gameNextLevel");
matchingGame.savingObject.currentLevel="game6.html";
uiNextLevel.click(function(e) {
e.preventDefault();
// location.href = "login.html";
location.href = matchingGame.savingObject.currentLevel;
});
Any idea please , Thank you in advance 🙂
You missed the hash
#in the selector, which meansidalso, for “dead links”, use a hash
#also in thehref.