<select name="subjectCode" class="beautify_input" id="optionSubject">
<option value="">请选择科目</option>
<c:forEach var="coursePlan" items="${list}" ><!-- ${list取其中的值} -->
<c:if test="${coursePlan.subjectCode != requestSubjectCode}">
<option courseplanId="${coursePlan.id}" value="${coursePlan.subjectCode}">${coursePlan.subjectName}</option>
</c:if>
<c:if test="${coursePlan.subjectCode == requestSubjectCode}">
<option courseplanId="${coursePlan.id}" selected="selected" value="${coursePlan.subjectCode}">${coursePlan.subjectName}</option>
</c:if>
</c:forEach>
</select>
coursePlanId = $('#optionSubject option:selected').attr('coursePlanId');