I'm having some trouble passing multiple parameters to a Javascript function.
The function:
function selectDino(dinosaurName, dinosaurHealth, dinosaurTraits)
{
localStorage.setItem("dinoName", dinosaurName);
localStorage.setItem("dinoHealth", dinosaurHealth);
localStorage.setItem("dinoTraits", dinosaurTraits);
location.replace("nextpage.html");
}
....
The call (mainly the "selectDino()" bits):
<img class="leftDino" src="dino1.png" onmouseover = getDino("dinoOne") onclick=selectDino("dinoOne", "20", "Banterous")>
<img class="centerDino" src="dino2.png" onmouseover = getDino("dinoTwo") onclick=selectDino("dinoTwo", "18", "Spiky")>
<img class="rightDino" src="dino3.png" onmouseover = getDino("dinoThree") onclick=selectDino("dinoThree", "22", "Bitey")>
Whenever I look on the Chrome Developer Console, it tells me the following:
Uncaught SyntaxError: Unexpected token }
Can anyone help with this?
EDIT
Added single quotes around the attributes and that's fixed the problem.