Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

set default date today js

$(document).ready( function() {
    var now = new Date();
 
    var day = ("0" + now.getDate()).slice(-2);
    var month = ("0" + (now.getMonth() + 1)).slice(-2);

    var today = now.getFullYear()+"-"+(month)+"-"+(day) ;


   $('#datePicker').val(today);
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript regex cheat sheet 
Javascript :: get id of element javascript 
Javascript :: ngstyle background url angular 
Javascript :: redis nodejs 
Javascript :: how to remove an object from array in react native 
Javascript :: how to add seconds to time in js 
Javascript :: upload form with doc type in ajax 
Javascript :: jquery dropdown select 
Javascript :: urlencoded limit nodejs express 
Javascript :: pushing element in array in javascript 
Javascript :: remove backslash from string 
Javascript :: nodejs event 
Javascript :: angular pipe to capitalize first letter 
Javascript :: react native apk bundle 
Javascript :: cordova android close app with back button 
Javascript :: wordpress not loading jquery 
Javascript :: node js download file to folder 
Javascript :: react bootstrap carousel caption placement top 
Javascript :: uploading file with fetch 
Javascript :: create a binary tree 
Javascript :: moment js get date 1 month 
Javascript :: settimeout function javascript for loop 
Javascript :: react select with custom option 
Javascript :: hashing in node js 
Javascript :: forming an object with reduce 
Javascript :: detect iframe content change javascript 
Javascript :: javascript write to text file 
Javascript :: angularjs change route js 
Javascript :: how to check input is selected or not 
Javascript :: javascript change font color based on value 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =