Restored script code for working with span elements with id