jquery method to get the current date_jquery
May 16, 2016 pm 04:20 PMThe example in this article describes how to get the current date with jquery. Share it with everyone for your reference.
The details are as follows:
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>jquery current date</title>
<script type="text/javascript" src="jquery-1.8.2.min.js"></script>
<script type="text/javascript">
$(function(){
function show(){
var mydate = new Date();
var str = "" mydate.getFullYear() "Year";
str = (mydate.getMonth() 1) "month";
str = mydate.getDate() "Day";
Return str;
}
$("input[type='button']").click(function(){
$("p").html("Today is " show());
});
});
</script>
</head>
<body>
<input type="button" value="Look at the current time" />
<p></p>
</body>
</html>
I hope this article will be helpful to everyone’s jQuery programming.

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to search previous Weibo by date on Weibo_How to search previous Weibo by date on Weibo

How to write a novel in the Tomato Free Novel app. Share the tutorial on how to write a novel in Tomato Novel.

How to recover deleted contacts on WeChat (simple tutorial tells you how to recover deleted contacts)

Quickly master: How to open two WeChat accounts on Huawei mobile phones revealed!

The secret of hatching mobile dragon eggs is revealed (step by step to teach you how to successfully hatch mobile dragon eggs)

How to set font size on mobile phone (easily adjust font size on mobile phone)

How to remove the date that appears automatically when printing from PPT handouts
