I’m putting together a new app and, while I normally use JQuery for things like this I’d like to compare it to Coffeescript and choose the right approach. Moreover, I want to make sure I understand how to invoke JQuery correctly using coffeescript.
The Dialog is in the following div:
<div class="alert-message error">
<a class="close" href="#">X</a>
<p>Here is some error text</p>
</div>
The styling puts an ‘X’ on the right margin of the dialog. When the user clicks the ‘X’, the entire div needs to disappear.
What JQuery code or Coffescript code would I use to close the dialog? This dialog could appear on any page in the site.
Try this: