<commit_before># html5-input-date-value-pollyfill


Allows you to set the value of `<input type="date" value="hello world" value="12/1/2015">`

by default the browser will render.

![](http://i.imgur.com/oRmClG4.png)

It will render the desired value

![](http://i.imgur.com/K0EQDp2.png)


## Demo

<iframe src="https://rawgit.com/jebaird/html5-input-date-value-pollyfill/master/demo.html" width="100%" height="250px" ></iframe>


### Getting setup

Include `<script type="text/javascript" src="html5-input-date-value-pollyfill.js"></script>` on your page. And add the following script

    (function(){
         var dateInputs = document.querySelectorAll('[type=date]'),
            input,
            i = dateInputs.length;

        while ( i-- ){
            input = dateInputs[ i ];
            input.value = html5InputDateValueParse( input.getAttribute('value') )
        }
    })()


The function ` html5InputDateValueParse()` can be called at any time if you add an input after the dom as been loaded.<commit_msg>fixed demo link<commit_after># html5-input-date-value-pollyfill


Allows you to set the value of `<input type="date" value="hello world" value="12/1/2015">`

by default the browser will render.

![](http://i.imgur.com/oRmClG4.png)

It will render the desired value

![](http://i.imgur.com/K0EQDp2.png)

Click [here](https://rawgit.com/jebaird/html5-input-date-value-pollyfill/master/demo.html) to see it in action.


### Getting setup

Include `<script type="text/javascript" src="html5-input-date-value-pollyfill.js"></script>` on your page. And add the following script

    (function(){
         var dateInputs = document.querySelectorAll('[type=date]'),
            input,
            i = dateInputs.length;

        while ( i-- ){
            input = dateInputs[ i ];
            input.value = html5InputDateValueParse( input.getAttribute('value') )
        }
    })()


The function ` html5InputDateValueParse()` can be called at any time if you add an input after the dom as been loaded.
{'fraction_non_alphanumeric': 0.1400198609731877, 'fraction_numerical': 0.01787487586891758, 'mean_word_length': 3.2066805845511483, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3966292', 'n_tokens_mistral': 662, 'n_tokens_neox': 631, 'n_words': 168}