-4

Having trouble to combine both javascript events together Both class actions occurred in different clicks.

<script>
    //first event
    $("#add-product-details-video").click(function () {
        hideAlertMsg();
    });
    //second event
    $(".add-more-image").on('click', function () {
        hideAlertMsg();
    });
</script>
manu
  • 351
  • 2
  • 15

1 Answers1

-1

Based on your comment you are missing comma between multiple element selectors:

$("#add-product-details-video .add-more-image").click(function () { hideAlertMsg(); });

Should be

$("#add-product-details-video, .add-more-image").click(function () { hideAlertMsg(); });
Ankit Agarwal
  • 30,378
  • 5
  • 37
  • 62