Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function fieldAdd(){
- let qNumber = document.getElementById("qNum").value;
- let containerBlocQ=document.getElementById('containerBlocQ');
- totalNumOfQuest = qNumber - nbQst;
- if(qNumber<=0){
- totalNumOfQuest=0;
- }
- if(totalNumOfQuest>=0){
- for(let i=1; i <= totalNumOfQuest ; i++){
- addNewQues();
- }
- }
- else{
- for(i=0;Math.abs(totalNumOfQuest);i++){
- //Here is the error
- removeLastQuestion();
- nbQst--;
- }
- }
- }
- function removeLastQuestion(){
- nbQst--;
- let containerBlocQ = document.getElementById('containerBlocQ');
- containerBlocQ.removeChild(containerBlocQ.lastChild);
- }
Add Comment
Please, Sign In to add comment