potrebbe essere:

if (number(total) != 10)
alert("err");