为什么单击时不显示警报?
我有这些 HTML:
<div id="submit-errors" class="alert alert-error fade in">
<button class="close" type="button" data-dismiss="alert"></button>
<h4 class="alert-heading">Errors</h4>
<p>sdfgsdg</p>
</div>
<button id='foo'>foo</button>
和 JS 脚本:
$('#submit-errors').alert('close');
$('#foo').on('click', function () {
$('#submit-errors').alert('open');
});
小提琴:http: //jsfiddle.net/XKYeg/1/