2
In my studies in JS I have the following code:
<select name='options'>
<option value="a">A</option>
<option value="b">B</option>
<option value="c">C</option>
</select>
<input class="input" type="text" />
<input class="input" type="text" />
<input class="input" type="date" />
I need it based on select to show input for his input.
Example: If I selected A, it shows input 1, if I selected B it hides 1 and shows 2. And so on. The idea is that only one input type element appears on the screen, and all others are with display: none;
However I cannot use an extra class to differentiate. What I had as idea was to use an array, and make a For, but I had no evolution with it.
can’t use
id
?– Marconi
not Marconi the idea is actually to use maybe a Sort and do the if`s to compare whether the val() corresponds to the input. It’s pretty crude example, why the idea is to actually use the array and make Indice matching.
– Edmo
I understood that according to the Dice of the first selected select select?
– Marconi
That’s right, something like A = 1, B = 2 and so on
– Edmo