【发布时间】:2016-07-19 06:25:22
【问题描述】:
我需要获取日期 onchange 的值,
这里是代码
<div class="input-daterange" data-date-format="dd/mm/yyyy">
<label>Date </label>
<input id="value_date" class="form-control" name="start" type="text" />
</div>
这是我的 jquery
$('#value_date').change(function() {{
var valuefirstone = document.getElementById('#value_date').value;
alert(valuefirstone);
}
</script>
Onchange 函数没有调用,我刚刚创建了更改警报,但它不起作用
【问题讨论】:
-
删除你的 getElementById 上的“#”
-
使用简单的 $('#value_date').val();
-
你为什么不使用 $(this).val() ?
-
函数没有调用onchange
标签: javascript jquery datepicker