selected option for select box while button click
What is wrong with below code: any idea
HTML :
- <select class="widthed" name="moveattrribseq" id="moveattrribseq" multiple="multiple" size="10" >
- <!-- Options will be added dynamically -->
- </select>
-
- <input type="button" class ="buttontext" name="next" id="next" value="Next">
Jquery :
- $(document).ready(function() {
- $('#next').click(function() {
- $('select#moveattrribseq').attr('selected','selected'); // this line is not working...
- });
- });
I need to auto select all select box options when I click button.