I have the following bootstrap markup and jQuery script and my select list item is not being pre-selected:
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="serviceType">Service Type</label>
<div class="col-md-1">
<select id="serviceType" name="serviceType" class="form-control">
<option value="S">S</option>
<option value="T">T</option>
<option value="X">X</option>
</select>
<script>
//$('[name=serviceType]').val( T ); // not working
//$('#serviceType').val( T ); // not working
//$('[name=serviceType]').val( "T" ); // not working
$('#serviceType').val( "T" ); // not working
</script>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
Can anyone see what is wrong with the jQuery? Thanks.
Appended Note #1: My jQuery CDN lib link is right before the closing tag whereas this container and javascript is up higher in the web doc. Does that matter?
Appended Note #2: Added the jQuery CDN lib for complete view.