0

When clicked,

selected: function(event, ui) {
    if (!$(ui.selected).hasClass('selected')) {  
        $(ui.selected).addClass('selected');
    } else {
        $(ui.selected).removeClass("ui-selected selected");
    }
}

I want to call the function I defined after the code is executed.

selected: function(event, ui) {
    if (!$(ui.selected).hasClass('selected')) {  
        $(ui.selected).addClass('selected');
    else {
        $(ui.selected).removeClass("ui-selected selected");
    }
    makeGrid();
}

When a calendar date is selected, the date cell changes color and I want makeGrid(); to be executed. makeGrid(); is executed, but the color of the selected date does not change.

2
  • Please click edit then the button marked [<>] and create a minimal reproducible example with relevant HTML, CSS , JS and frameworks from CDN Commented Sep 3, 2024 at 9:10
  • 3
    You have a syntax error in your second code before else (one } is missing). also please create a minimal reproducible example, so that we can help you properly. Commented Sep 3, 2024 at 9:34

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.