Home  >  Article  >  Web Front-end  >  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
WBOYOriginal
2016-05-16 17:25:001275browse
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.
Statement:
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