Updated to work with multiple selections and added a parameter for a custom enclosing tag, span by default.