Use prop() method to make it work on Safari.