JQuery Age calculation on date

前端 未结 7 1310
挽巷
挽巷 2020-12-15 06:34

Am I missing something in the following jQuery code?

var dob = $(\'#date\').val();
if(dob != \'\'){
    var today = new Date();
    var dayDiff = Math.ceil(t         


        
7条回答
  •  悲&欢浪女
    2020-12-15 07:12

    Firstly the id mentioned in the textbox should not contain '#'

    I have also Created a fiddle

    Oops i had't checked the date it was posted on

提交回复
热议问题