How to Get and Set attributes in JavaScript