Get Index Of Selected Text Javascript