In your javascript,you have already stored the year values in y1 and y2.Then y do u need to assign them to x1 and x2?? Exclude x1 and x2 assignment statements and change the if condition to compare...