changed main.js to add a elements instead of span

It seems that using mousedown along with span elements does not work in
some mobile browsers. It is better to use a with click event.