Add JavaScript functionality