Skip to content
Advertisement

Icon clicking to show the date

I am creating the input field to show the calendar date. Now I just only can click the input field to show the calendar date. Actually, I want to click the calendar icon to show the calendar date, then the calendar date will show in the input field, not click the input field to show the calendar. Hope someone can guide me on how to solve it. Thanks.

Below is my coding:

JavaScript

This is my output:

enter image description here

Actually, I want the expected result like below the picture. Can click the icon show the date then after choosing the date can show in the input field:

output 2

Advertisement

Answer

Try like this:

JavaScript

Here is the example

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement