1 回答
TA贡献1796条经验 获得超4个赞
function eventtime(){
var day=$('#select_box').children(":selected").val();
console.log("Day= "+day)
$.ajax({
type: "POST",
url: "assets/pages/habshine/events.php",
data: "day=" +day,
success: function(msg){
$("#main").html(msg);
}
});
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<select style="margin-bottom: 8px; width: 14%; float: left;" onChange="eventtime();" id="select_box">
<option value="1">Monday</option>
<option value="2">Tuesday</option>
<option value="3">Wednesday</option>
<option value="4">Thursday</option>
<option value="5">Friday</option>
<option value="6">Saturday</option>
<option value="7">Sunday</option>
</select>
如果选择框的值将发生变化,则转到eventtime()函数。该功能首先过滤所选日期对应的值并发布到以下网址。
- 1 回答
- 0 关注
- 117 浏览
添加回答
举报