i build a small function its adds drop down value to div, but my requirement it that whenever name add in div it suppose to come in new line and it should be in ascending order, i tried it but i am not reaching up to the solution.
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(function(){
var str = "";
$('#me').change(function(){
str += $(this + "option:selected").text()
$('#text').text(str)
})
});
</script>
<style>
.main {
margin:0 auto;
width:500px;
border:solid 1px #F00;
height:500px
}
#text{ margin-left:50px; margin-top:50px; font:24px/18px Tahoma, Geneva, sans-serif; color:#F00}
</style>
</head>
<body>
<div class="main">
<select id="me">
<option>first</option>
<option>second</option>
<option>third</option>
<option>fourth</option>
</select>
<div id="text"></div>
</div>
</body>