Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

textinput

Explorer ,
Oct 29, 2021 Oct 29, 2021

question, answer1,answer2,answer3,answer4 are Textinput compenent in the stage.

in this  add_ques buton i place the value in array thr i want to reset the value for new question 

so i do:  $('#question').val()="";

but it is not working.

how can i reset the textinput?

 

this.add_ques.addEventListener("click", newQuestion.bind(this));

function newQuestion()
{
qnum=qnum+1;
myVal = $('#question').val(); questions [qnum][1] = myVal;
myVal = $('#answer1').val(); questions [qnum][2] = myVal;
myVal = $('#answer2').val(); questions [qnum][3] = myVal;
myVal = $('#answer3').val(); questions [qnum][4] = myVal;
myVal = $('#answer4').val(); questions [qnum][5] = myVal;
$('#question').val()="";
$('#answer1').val()="";
$('#answer2').val()="";
$('#answer3').val()="";
$('#answer4').val()="";
}

77
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation