Update modal.js

Use function-chaining and an object of key/value pairs when using the "attr()" function.