I'm messing with a Select, where I hedge its index. The problem that after setting the index I have to put it inside a div.
But it does not get the index set, it goes with the default. What function of jquery, cuts the select with what was assigned to it, so I can do the insertion of what I want.
<select class="my">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
<select class="menor">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
$(document).ready(function() {
$(".my, .menor").prop('selectedIndex', -1);
$(".my").after("<div class='maior'></div>").prependTo(".maior");
});
Ex: link