Home > Web Front-end > JS Tutorial > js code to determine whether the selected time is greater than today_javascript skills

js code to determine whether the selected time is greater than today_javascript skills

WBOY
Release: 2016-05-16 17:25:00
Original
1350 people have browsed it
Copy code The code is as follows:

<script>$("#pseudo_review_time' goods_id '"). datepicker({dateFormat: "yy-mm-dd"});$("#pseudo_review_time' goods_id '").change(function(){var thetime=$(this).val();var d=new Date( Date.parse(thetime.replace(/-/g,"/")));var curDate=new Date();if(d >curDate){alert("Please select a time less than today!");$ (this).val("");$(this).focus();}});</script>

When I use it, jQuery UI is very powerful, and the date in it Choose the plug-in Datepicker to use with it, it is very useful.
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template