use quotes around all element attribute values in JS

Fixes #12946. Also more consistent with our CSS code style.