improve getSelectorFromElement
Created by: Johann-S
Two points to improve this function:
- Remove try/catch to let our users know why something failed
- Just return the element not just the selector
https://github.com/twbs/bootstrap/blob/master/js/src/util/index.js#L31