Changed .attr('value') to .val()