I have a drop down. One of the selections is Please Enter.
How do I force it to go to Please Enter
The id of the selectlist is called makeSelection
$('select.makeSelection').val("Please Enter").attr('selected', 'selected');
I have a drop down. One of the selections is Please Enter.
How do I force it to go to Please Enter
The id of the selectlist is called makeSelection
$('select.makeSelection').val("Please Enter").attr('selected', 'selected');
$("#makeselection option[value='Press Enter']").prop('selected', 'selected');
For jQuery 1.6 you can use
$("#makeselection option[value='Press Enter']").attr('selected', 'selected');
Edit : Similar post
You may even be interested in why Prop and Attr
If makeSelection is the Id, there will be only one so
$('#makeSelection').val("Please Enter").attr('selected', 'selected');
is enough.