Here's an example of an alert I'm using:
<div class="alert alert-error" id="passwordsNoMatchRegister">
<span>
<p>Looks like the passwords you entered don't match!</p>
</span>
</div>
I know that $(".alert").show()
and $(".alert").hide()
will show/hide all the elements of the .alert
class. However, I cannot figure out how to hide a specific alert, given its id.
I want to avoid using .alert("close")
, since that permanently removes the alert, and I need to be able to recall it.
$()
will find elements matching that selector.div
,.class_name
,#elem
etc. It'll even do special selectors like attribute selectors[id="id_name"]
or*
. Just think of it as a css selector and you should feel more creative using it.fiddle
to reproduce your problem?<script src="http://code.jquery.com/jquery.js"></script>
in my header (which is why nothing from jQuery was working).