Greetings! I have encountered an issue where both of my buttons work perfectly fine individually, but when I attempt to use Button A to click Button B using JavaScript, it doesn't seem to work. I can confirm that Button A functions correctly as the alert included in the script pops up, however, it fails to trigger Button B. I've attempted various methods including using classes and IDs without success. Any assistance would be greatly appreciated.
//Button A
<a class="send-btn"> <?php echo $buttontext?> </a>
//Button B
<a id="open-modal" class="openmodal-btn" data-toggle="modal" data-backdrop="static" data-keyboard="false" data-target="#modal">
// I tried adding these in the js Script while testing.
$("#openmodal-btn").click();
$('.openmodal-btn').click();
<script>
$(document).ready(function(){
$('.send-btn').click(function(event){
$('.openmodal-btn').trigger('click');
});
});
</script>