Learning javascript/jquery using a calculator