0
How can I turn inputs into a droplist menu, via jQuery?
My code:
<li class="select skuList item-dimension-Tamanho">
<span class="group_0">
<input name="293_Tamanho" dimension="Tamanho" data-value="P(S)" data-dimension="Tamanho"
class="skuselector-specification-label input-dimension-Tamanho sku-selector skuespec_Ps change-image"
id="293_Tamanho_0" value="P(S)" specification="Ps" type="radio">
<label for="293_Tamanho_0" class="dimension-Tamanho espec_0 skuespec_Ps skuespec_Tamanho_opcao_P(S) skuespec_Tamanho_opcao_Ps">
P(S)
</label>
<input checked="checked" name="293_Tamanho" dimension="Tamanho" data-value="M(M)"
data-dimension="Tamanho" class="skuselector-specification-label input-dimension-Tamanho sku-selector skuespec_Mm change-image checked sku-picked"
id="293_Tamanho_1" value="M(M)" specification="Mm" type="radio">
<label for="293_Tamanho_1" class="dimension-Tamanho espec_0 skuespec_Mm skuespec_Tamanho_opcao_M(M) skuespec_Tamanho_opcao_Mm checked sku-picked">
M(M)
</label>
<input name="293_Tamanho" dimension="Tamanho" data-value="G(L)" data-dimension="Tamanho"
class="skuselector-specification-label input-dimension-Tamanho sku-selector skuespec_Gl change-image"
id="293_Tamanho_2" value="G(L)" specification="Gl" type="radio">
<label for="293_Tamanho_2" class="dimension-Tamanho espec_0 skuespec_Gl skuespec_Tamanho_opcao_G(L) skuespec_Tamanho_opcao_Gl">
G(L)
</label>
<input name="293_Tamanho" dimension="Tamanho" data-value="GG(XL)" data-dimension="Tamanho"
class="skuselector-specification-label input-dimension-Tamanho sku-selector skuespec_Ggxl change-image"
id="293_Tamanho_3" value="GG(XL)" specification="Ggxl" type="radio">
<label for="293_Tamanho_3" class="dimension-Tamanho espec_0 skuespec_Ggxl skuespec_Tamanho_opcao_GG(XL) skuespec_Tamanho_opcao_Ggxl">
GG(XL)
</label>
</span>
</li>
Follow an image of the effect I need:
Remembering that I have no control of the HTML it generates.
What do you want to do when you say "I could transform "? Can you explain what you want to change?
$
.item-Dimension-Size input')` selects all inputs in this code that you have placed– Sergio
Transform the elements
radio
inoption
of aselect
? In fact the elements have enough attributes, I would like to keep them ?– DontVoteMeDown
I need Inputs to be in dropdown form, and not displayed by default! I will post an image to illustrate better!
– Julio Santos
Yes I would like to keep the attributes, just turn them into droplist
– Julio Santos