How to make <input type=“date”> supported on all browsers? Any alternatives?

前端 未结 11 2045
不知归路
不知归路 2020-11-29 16:57

I\'m working with HTML5 elements input attributes and only Google Chrome supports the date, time attributes. I tried Modernizr but I can\'t understand on how to integrate it

11条回答
  •  再見小時候
    2020-11-29 17:41

    You asked for Modernizr example, so here you go. This code uses Modernizr to detect whether the 'date' input type is supported. If it isn't supported, then it fails back to JQueryUI datepicker.

    Note: You will need to download JQueryUI and possibly change the paths to the CSS and JS files in your own code.

    
    
        
            Modernizer Detect 'date' input type
            
            
            
            
            
            
            
        
        
            

    I hope this works for you.

提交回复
热议问题