Hi there
I am still new to JavaScript and am trying to work out a small script that functions as flashcards to learn Japanese vocab. The code below shows pretty much what I want to do, however I wish to make the "next" button repeat the script for the next pair of words in the 2 arrays (ie Japanese and it's meaning in English. Any assistance would be greatly appreciated.
[CODE]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Japanese Vocab</title>
</head>
<body>
<h1>Japanese Vocab</h1>
<p id="japanese"></p>
<p id="english"> </p>
<button onclick="showEnglish()">Answer</button>
<button onclick="nextWord()">Next word</button>
<script type="text/javascript">
var japanese=new Array("食べる","読む","行く");
var english=new Array("to eat","to read","to go");
document.getElementById("japanese").innerHTML=japanese[0];
function showEnglish()
{
document.getElementById("english").innerHTML=english[0];
}
</script>
</body>
</html>
[CODE]