/ Published in: JavaScript
This prepends a `#` if it's not already there. Useful when doing jQuery selectors.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Evan.idify = function(id) { if (id[0] !== '#') return '#' + id; return id; }