I currently have a situation that really may not be the big deal, but I have tried to search everywhere and I really have not found the answer to my problem.
Well, we all know that the <select>
tag is used to create a list of <option>
, I am working in JavaScript with a code based on HTLM, since I am doing a page with dynamic elements that do not need to reload the page for to fulfill its function, for that reason I do not want to put PHP to the code, since PHP needs to reload the page for its functions, the problem is that I have no idea what to do after defining the possible options of the select.
<select id="opcion" required>
<option value="1">boton 1</option>
<option value="2">boton 2</option>
</select>
What I would like to do is that when selecting the first option, show a button and then if I press the second option, hide the first button and create a new one.
The buttons if I know how to configure them, really this question is simple and short, but I can not find anywhere to apply the conditions of the select, try with a IF
, but nothing happened.