Link to home
Start Free TrialLog in
Avatar of Alex Lord
Alex Lord

asked on

Trigger button with JS or JQ

<button  id="bind-trigger"></button>

Open in new window



So i have this button

im trying to trigger it with js instead of a user click but no success.

$('#bind-trigger').trigger('click');
    
    $("#bind-trigger").on('click', function() {
        alert("Bind Triggered");
    
    });
    

Open in new window


i came acorss this online and it doesnt work but is it possible to trigger a click ?
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial