How to add div id dynamically in jquery using wrap i.e. $(this).wrap('<div class="selectbox"/>'); for each drop down ($select) the id that is generated should be different for each drop down.
Update
$(document).ready(function() {
$("select").each(function() {
var id = $(div).att("id");
$(this).wrap('<div class="selectbox"/>');
$(this).after("<span class='selecttext'></span><span class='select-arrow'></span>");
var val = $(this).children("option:selected").text();
$(this).next(".selecttext").text(val);
});
});
This is what i am trying to do .. In this i need to add the div id which should be dynamically created.
Use this instead: