0
這裏是我的jsp:如何獲取HTML標記ID的值並將其存儲在使用jQuery的變量中?
<h1>Drop Down Menu</h1>
<div class="dropdown">
<select name="doctype" id="${rep}" class="my_dropdown" style="color:white; background:#655D78">
<option disabled="disabled" selected="selected">Select Doc Type</option>
這裏是我的jQuery函數:
<script type="text/javascript">
$(document).ready(function() {
var name = $("").val(); //value of the html id to be stored
alert($.name);
$.ajax({
url:'',
type:'post',
cache:false,
success: function(response){
}
});
});
</script>
我想$ {}代表這個值是在jQuery的功能。 任何人都可以幫我在這裏嗎?
你當選擇標籤選擇時想獲得ID?或選擇標籤打開時間? –