Replace .attr() function with .val()