Build a calculator


#1

My code looks like this, works fine, but when I try do go to next lesson it says that I need to try again. What is the problem?
$(document).ready(function(){
var testNumLength = function(number) {
if (number.length > 9) {
totaldiv.text(number.substr(number.length-9,9));
if (number.length > 15) {
number = "";
totaldiv.text("Err");
}
}
};
var number = "";
var newnumber = "";
var operator = "";
var totaldiv = $("#total");
totaldiv.text("0");

//Add your .click() here!
$("#numbers a").not("#clear,#clearall").click(function(){
    number += $(this).text();
    totaldiv.text(number);
    testNumLength(number);    
    });

});


#2

Had the same problem.
I left testNumLength(); without the number in it and worked.

Edit 1: Okay, so it got changed to testNumLength(number); after I started next part.