bootstrap datetimepicker 插件怎样获取时间值
1个回答
展开全部
开始时间:
<div class="controls input-append date form_datetime " data-date-format="yyyy-mm-dd hh:ii " data-link-field="dtp_input1"> <input id="start_time" class="form-control input-sm" size="20" type="text" value=""
readonly>
<span class="add-on"><i class="icon-remove"></i></span><span class="add-on"><i class="icon-th"></i></span>
<div>
<script type="text/JavaScript"> </div>
//时间选择器
$(".form_datetime").datetimepicker({
language: "zh-CN",
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
forceParse: 0,
showMeridian: 1
});
//jQuery选择器获取时间值,.val()方法
$("#data").click(function(){
console.log($("#datetime").val());
});
<script>
<div class="controls input-append date form_datetime " data-date-format="yyyy-mm-dd hh:ii " data-link-field="dtp_input1"> <input id="start_time" class="form-control input-sm" size="20" type="text" value=""
readonly>
<span class="add-on"><i class="icon-remove"></i></span><span class="add-on"><i class="icon-th"></i></span>
<div>
<script type="text/JavaScript"> </div>
//时间选择器
$(".form_datetime").datetimepicker({
language: "zh-CN",
weekStart: 1,
todayBtn: 1,
autoclose: 1,
todayHighlight: 1,
startView: 2,
forceParse: 0,
showMeridian: 1
});
//jQuery选择器获取时间值,.val()方法
$("#data").click(function(){
console.log($("#datetime").val());
});
<script>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询