Can I check if Bootstrap Modal Shown / Hidden?

user2736812 picture user2736812 · Oct 30, 2013 · Viewed 104.7k times · Source

Can I check if Bootstrap Modal currently Shown / Hidden Programatically?

Like bool a = if("#myModal").shown(); ?

I need true/false

Answer

user2663434 picture user2663434 · Oct 30, 2013
alert($('#myModal').hasClass('in'));

It will return true if modal is open