I'm trying to create a calendar in JS.
First I made a <table>
that will fill the <td>
according to the days, leaving all available to click and select a certain day. The user selects a forward day and a return day (changing the style of the selected date when clicking) and dates are redirected to given <input>
. And here's the problem, by clicking on several <td>
, they keep changing the style, without a click control.
Here's an example of how I'm doing to recognize the clicks:
function daysD(){
$("td").click(function (){
this.style.color = "#FFF";
this.style.backgroundColor = "#65BC2B";
});
}
Are you able to control the number of clicked times to recognize only two clicks?