The board of aldermen shall have power to fix the compensation of all the officers and employees of the city, by ordinance. But the salary of an officer shall not be changed during the time for which he was elected or appointed.