Lord Vermillion Lord Vermillion - 1 year ago 96
jQuery Question

perform data-toggle with jquery

I have a button that toggles a bootstrap modal.

<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">

I want to do the same thing with a jquery function. Is this possible?

Answer Source

give your button id and hide it:




<button class="btn btn-primary btn-lg" id="btnTrigger" data-toggle="modal" data-target="#myModal">

and on someother event or condition just click it programmatically:



In Result, popup will be displayed.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download