这是代码:
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script>
function showSuccess() {
$('#successDiv > p').empty().append("Saving the Device Whitelist was a success.<br />Server Resonse: Sucess");
$('#successDiv').toggle().delay(4000).toggle();
}
$(function () {
$('#successDiv').on('click', function () {
showSuccess();
})
});
</script>
</head>
<body>
<div id="successDiv" style="display:none">
<p>Hello</p>
</div>
<input type="button" id="showSuccess" value="Show Success" />
</body>
</html>
由于某种原因,切换不起作用...
这是jsfiddle