Return to Snippet

Revision: 56142
at March 12, 2012 10:01 by EvanHahn


Initial Code
Evan.idify = function(id) {
	if (id[0] !== '#') return '#' + id;
	return id;
}

Initial URL

                                

Initial Description
This prepends a `#` if it's not already there. Useful when doing jQuery selectors.

Initial Title
JavaScript IDify

Initial Tags
jquery

Initial Language
JavaScript