jQuery(document).ready(function ($) {
    // When the notice is dismissed
    $(document).on('click', '.machinery-rental-notice .notice-dismiss', function () {
        $.post(ajaxurl, {
            action: 'machinery_rental_dismiss_notice'
        });
    });
});