<form role="form" id="next_question" method="post">
<button type="button" name="next_button" id="next_button" class="btn btn-primary btn-lg" onclick="nextQuestion();" >Next</button>
</form>
How to write this JavaScript code in PHP?
function nextQuestion() {
let quest = document.getElementById('question').innerHTML;
ques_list.push(quest);
answer_list.splice(counter-1, 1, radio_id);
getQuestion();
counter++;
if(counter >= 10) {
result_button='<button type="button" name="end_button" id="end_button" class="btn btn-primary" onclick="submitAnswer();" >Submit Answers</button>'
document.getElementById('button_group').innerHTML=result_button;
}
}
Rishabh Dwivedi
web developer
Girish Patil
Full-stack engineer
Hey, Can you be a bit clearer on what you are trying to do? and the editor supports Markdown. So try to wrap your code in
codelike this. It will be much more clearer. More ref on Markdown dillinger.io