How to display and hide radio and query a set of single-choice questions from the database,
$ V) {?>
The code above is the code displayed on the page after it is queried from the database,
How can I display only one UL?
After clicking the radio button, hide the current UL and display the next UL?
Reply to discussion (solution)
JQuery makes it easy to implement
Give each ul a class related to $ key, such as class = "ul _". $ k
Then, give raido a click event. when clicked, find the ul of class = "ul _" + k in its parent class and hide it ($ (". ul _ "+ k ). hide ();) and show the ul of class = "ul _" k + 1 $ (". ul _ "k + 1 ). show ();
In addition, ajax is recommended for questions. Currently, dom only selects one question and sends it to the background for the next question.
JQuery makes it easy to implement
Give each ul a class related to $ key, such as class = "ul _". $ k
Then, give raido a click event. when clicked, find the ul of class = "ul _" + k in its parent class and hide it ($ (". ul _ "+ k ). hide ();) and show the ul of class = "ul _" k + 1 $ (". ul _ "k + 1 ). show ();
In addition, ajax is recommended for questions. Currently, dom only selects one question and sends it to the background for the next question.
How do I use ajax?
JQuery makes it easy to implement
Give each ul a class related to $ key, such as class = "ul _". $ k
Then, give raido a click event. when clicked, find the ul of class = "ul _" + k in its parent class and hide it ($ (". ul _ "+ k ). hide ();) and show the ul of class = "ul _" k + 1 $ (". ul _ "k + 1 ). show ();
In addition, ajax is recommended for questions. Currently, dom only selects one question and sends it to the background for the next question.
How do I use ajax?
Just like ajax, upload the number of the current question to the background to retrieve the next question, and then replace the retrieved content with the current content.
JQuery makes it easy to implement
Give each ul a class related to $ key, such as class = "ul _". $ k
Then, give raido a click event. when clicked, find the ul of class = "ul _" + k in its parent class and hide it ($ (". ul _ "+ k ). hide ();) and show the ul of class = "ul _" k + 1 $ (". ul _ "k + 1 ). show ();
In addition, ajax is recommended for questions. Currently, dom only selects one question and sends it to the background for the next question.
How do I use ajax?
Just like ajax, upload the number of the current question to the background to retrieve the next question, and then replace the retrieved content with the current content.
Do not understand ajax
JQuery makes it easy to implement
Give each ul a class related to $ key, such as class = "ul _". $ k
Then, give raido a click event. when clicked, find the ul of class = "ul _" + k in its parent class and hide it ($ (". ul _ "+ k ). hide ();) and show the ul of class = "ul _" k + 1 $ (". ul _ "k + 1 ). show ();
In addition, ajax is recommended for questions. Currently, dom only selects one question and sends it to the background for the next question.
How do I use ajax?
Just like ajax, upload the number of the current question to the background to retrieve the next question, and then replace the retrieved content with the current content.
Do not understand ajax
Sorry, that's why I went far. I can use the method I mentioned earlier.
In addition, ajax is very important in current website development... and it is very simple. you can learn it in half an hour (JQuery's ajax ).
If necessary, you can search for the relevant information and check out any ideas or questions.