Onfocus input change type and assign a value at the same time

0

Hello, I have the following code.

What I have today is that by clicking on input it changes the input to date, but I would like to click it to keep changing and assign a date, I already tried onfocus="(this.value='2018-06-21')" next to other onfocus that I already have but without success.

<input type="text" name="dtfinal" onfocus="(this.type='date')" onfocusout="(this.type='text')" placeholder="Data Final">
    
asked by anonymous 21.06.2018 / 15:16

1 answer

1

Just separate with a comma.

<input type="text" name="dtfinal" onfocus="(this.value = '2018-06-21', this.type='date')" onfocusout="(this.type='text')" placeholder="Data Final">
    
21.06.2018 / 15:21