なぜこれがエラーを返すのですか? 私の頭のタグで...
var movieArray = [
["Everything is Illuminated", "0", ""],
["The Girl Who Leapt Through Time (Toki wo kakeru shojo)", "1", "<ol><li><span class=\"bold quote_actor\">Kosuke Yoshiyama: </span><span class=\"line\">It's not that rare. Many girls do it at your age.</span></li> </ol>"],
["Freedom Writers", "0", ""],
["Inside Man", "0", ""]
];
function checkAnswer(this.value) {
if (this.value == 0) {
alert ("Wrong answer!");
} else {
alert ("Correct Answer!");
}
}
体内で...
<p><a id="0" class="btn btn-primary btn-large" value="0" onclick="checkAnswer(this.value)">Everything is Illuminated</a></p>
<p><a id="1" class="btn btn-primary btn-large" value="1" onclick="checkAnswer(this.value)">The Girl Who Leapt Through Time (Toki wo kakeru shojo)</a></p>
エラーは checkAnswer() が定義されていません。どうして?
ありがとう。