I wan to display a message into a div rather than alert it, then hide it on click/blur
The alert is popping up due to an error of typing. I need to display a message into a div and not an alert.
Something like:
$('form.form-calculator input').on('change click', function() {
if ($(this).val() == 0) {
var div = $("#AlertMessage");
div = $("<div id='AlertMessage' onclick='$(this).hide();'></div>");
$("body").prepend(div);
this.value=0;
}
calc_total();
});
With the Alert
$(function () {
$('.form input').on('change click focus', function () {
if ($(this).val() == 0) {
alert('HELLO');
this.value = 0;
}
calc_total();
});
});