This act shall apply only to such cities as may elect to come under the same by ordinance.