<script>
var xTurn = true;
function changeImage()
{
element=document.getElementById('myimage')
if (element.src.match("/wp-content/uploads/2013/07/squaree.png") && xTurn)
{
xTurn = false;
element.src="/wp-content/uploads/2013/07/xx.png";
}
else if (element.src.match("/wp-content/uploads/2013/07/squaree.png") && xTurn==false);
{
xTurn = true;
element.src="/wp-content/uploads/2013/07/circ.png";
}
}
</script>
<img id="myimage" onclick="changeImage()" src="/wp-content/uploads/2013/07/squaree.png" width="90" height="90">
何らかの理由で、この関数内で xTurn が機能しないようです。間違っているかどうかを参照していますか?ちなみにワードプレスです。xTurn を使用せずに画像が変更されることを確認済みです。