Сделал небольшой код, должно будет работать как тест. Не вызывается функция check1 (значение);
Каким образом можно решить проблему?
<html>
<head>
<meta charset="utf-8">
<title>Tester Script</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<table id="mainField" cellpadding="0" border="0" bordercolor="black" align="center">
<tbody>
<td>
<div id="question1" align="center" valign="center" class="questionField">
<p class="question">Вопрос 1</p>
<table class="answerTable" cellpadding="0" border="0" bordercolor="black" align="center">
<tbody>
<td><button class=answerButton onClick="check1(1);">Вариант 1</button></td>
<td><button class=answerButton onClick="check1(2);">Вариант 2</button></td>
<td><button class=answerButton onClick="check1(3);">Вариант 3</button></td>
</tbody></table>
</div>
</td></tbody></table>
<script language="javascript">
var score = 0;
var answer1 = 1;
var answer2 = 1;
var answer3 = 1;
var questionMain = document.getElementById("question1");
var question2 = '<p class="question">Вопрос 2</p><table class="answerTable" cellpadding="0" border="0" bordercolor="black" align="center"><tbody><td><button class=answerButton onclick="check2(1)">Вариант 1</button></td><td><button class=answerButton onclick="check2(2)">Вариант 2</button></td><td><button class=answerButton onclick="check2(3)">Вариант 3</button></td></tbody></table>' ;
function check1 (answer) {
if (answer == answer1) {
score++;
}
questionMain.innerHtml= question2;
}
function check2 (answer) {
if (answer == answer2) {
score++;
}
}
</script>
</body>
</html>