I'm using scalajs-react and I'd like to hide a bootstrap alert instead of removing it from the DOM. I found this javascript code here
$('.alert .close').on('click', function () {
$(this).parent().hide();
})
Which I wrongly translated to scalajs-react with the following code:
.componentDidMount(scope => Callback {
jQuery(scope.getDOMNode()).on("click", null, null, Alert.closed _)
}
The obvious problem is that it hides the alert when I click anywhere on it (not only on the button). How can I translate this $('.alert .close')?