I need to select some value in the drop-down menu and the questions change depending on the value. How to do it with javascript 'om? Thank you in advance.

  • I don’t know javascipt at all, so everything is very detailed to me =) - Dikaz
  • @Dikaz, if you don’t know javascipt at all, then you do not have a question, but an order to do the work. - Deonis
  • hmm .. I didn’t think about it ... I just don’t want to rummage through the javascript for such an unimportant thing (in my case) .. in fact, it’s just the only thing that is needed (I would like to give the teacher as much as possible) in two I will start to learn javascript myself then there will be more serious questions. - Dikaz
  • @Dikaz, and in what form do you have questions? - Deonis
  • @Deonis, what are they doing ? - Zhukov Roman

1 answer 1

In general, while you are considering how to answer my question about storing your questions, here is a simple example of implementing it in pure JS. Although, if your teacher permits, then it will be possible to implement on jQuery.

  • I wanted to store them in the html code, that is, I have two blocks. At the beginning they are not visible and after selecting, say the floor, these questions come out. - Dikaz
  • @Dikaz, let's not guess, but put a part of the html-code related to this problem on jsFiddle - Deonis
  • but your example also suits me very much. I have a question, if we write next to the form questions they will be perceived by html? - Dikaz
  • Here <div class = "i"> I </ div> <select class = "sel" name = "status" size = "1"> <option value = "tchr"> Teacher </ option> <option value = " prnt "> Parent </ option> </ select> <div style =" clear: both; "> </ div> if university teacher: <br> <input type =" text "name =" inst "SIZE =" 20 "placeholder =" MSU "required /> <br>, etc. and if the parent Phone Number: <br> <input type = "text" name = "inst" SIZE = "20" placeholder = "89 *********" required /> <br> - Dikaz
  • >> if we write next to the form questions they will be perceived by html? answer: will be - heleg