easyui-datebox 日期控件的值改变是能触发事件是什么,onchange没有效果?望指导

我要怎么才能通过js拿到日期控件改变的值,并通过js给日期控件赋值。
日期控件代码 如下:


<input name="time" id="mintime"  style="width: 230px;height: 33;"class="easyui-datebox"  onchange="posTimeName(this.value)"  value='<%= request.getAttribute("MapBef7day") %>'/>

<input style="width: 230px;height: 33;margin-left: 10px;margin-top: 15" id="maxtime" class="easyui-datebox" name="time" onchange="posTimeName(this.value)"  value='<%= request.getAttribute("MapToday") %>'/>

            

            

js代码:

https://img2.mukewang.com/5be3d57b000193a607670358.jpg

繁花如伊
浏览 3965回答 1
1回答

当年话下

onchange事件在内容改变(两次内容有可能相等)且失去焦点时触发,所以未失去焦点的时候,是不会触发的。想要在改变值的时候触发可以使用oninput或者onpropertychange, oninput事件(因为你要用JS触发,会失效所以不推荐),你可以试试onpropertychange事件
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript