<script src="http://code.jquery.com/jquery-latest.js"></script>
<button onclick="showErr(this)">Ошибка 1</button>
<button onclick="showErr(this)">Ошибка 1, Ошибка 2</button>
<button onclick="showErr(this)">Ошибка 2, Ошибка 3</button>
<div id="cont"></div>
<script>
(function () {
var Isx='<span>&. </span>',TimerId_00,OBJ={};
return showErr = function (a) {
errors=$(a).html().split(/,\s*/i);
for (var i in errors) {OBJ[errors[i]]=Isx.replace('&',errors[i]);}
clearTimeout(TimerId_00);TimerId_00=setTimeout(function(){OBJ={};$("#cont").html('')}, 5000);
$("#cont").html('');
for (var key in OBJ) {$("#cont").append(OBJ[key]);}
}
}())
</script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<div id="but-wrp">
<button>Ошибка 1</button>
<button>Ошибка 1, Ошибка 2</button>
<button>Ошибка 2, Ошибка 3</button>
</div>
<div id="cont"></div>
<script>
(function () {
var Isx='<span>&. </span>',TimerId_00,OBJ={};
$("#but-wrp button").click(function () {
errors=$(this).html().split(/,\s*/i);
for (var i in errors) {OBJ[errors[i]]=Isx.replace('&',errors[i]);}
clearTimeout(TimerId_00);TimerId_00=setTimeout(function(){OBJ={};$("#cont").html('')}, 5000);
$("#cont").html('');
for (var key in OBJ) {$("#cont").append(OBJ[key]);}
});
}())
</script>