简体   繁体   中英

Using JavaScript, how can I display a set of questions on my quiz application?

I am making a quiz application using jQuery and JavaScript.

The application has next, previous and submit buttons.

Suppose I am on Q12 but want to immediately go to Q2, I have no provision for this sort and want to have this provision.

How do I display buttons for all questions and by clicking on that button would reach that particular question?

How can I use data-pages to do this?

There could be tons of solutions for this problem.

Assume you have 20 questions. Create 20 div s with style display:none . So these will be invisible. Let first div 's style as display:block . So it will be visible. Have a combobox with items Question 1, Question 2... Question 20. Listen changes on combobox so you will set display:block for selected question's div and display:none the older one.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM