replaced .prop with .attr in getVal function