royhowie royhowie - 1 year ago 62
HTML Question

How can I show/hide a specific alert with twitter bootstrap?

Here's an example of an alert I'm using:

<div class="alert alert-error" id="passwordsNoMatchRegister">
<p>Looks like the passwords you entered don't match!</p>

I know that
will show/hide all the elements of the
class. However, I cannot figure out how to hide a specific alert, given its id.

I want to avoid using
, since that permanently removes the alert, and I need to be able to recall it.

Answer Source

You need to use an id selector:


# is an id selector and passwordsNoMatchRegister is the id of the div.

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