JavaScript Building Blocks

Hi, this is my first post on MDN, I have read through the articles of JavaScript Building Blocks and trying to apply the learnings. I am making a code that would allow the user to select a date of Departure and date of Return using a calendar. The code has succeeded in displaying the calendar but failed to show the alert if the user has inputted the right date of departure. I am trying to put together the concepts of Variables, Events, Functions and Conditionals. I hope to hear from the community how to get this done. Below is the code. Thank you!

Date of Departure

Date of Return

Hi @albertdan40, and welcome to our community!

I’d be happy to help you out on this, but I can’t see your code below — Discourse has an annoying habit of rendering HTML code rather than displaying it. This is because it uses markdown syntax, which also includes rendering HTML.

You can fix this by wrapping your code block in “code fences” — put a line of three backticks (`) before your code, and another one after it, and it will be rendered as a code block.

Even better would be to put your code into a live code editor application (like CodePen or JSFiddle), and send us the link so we can run it and see what happens.

Best regards.