Fix compatibility with jQuery 1.9.x

I changed all the `.attr('value')` and `.attr('value', myVal)` respectively by `.val()` and `.attr(myVal)`.

Everything works fine now.