smash attribute in javascript