I'd like to take an email address and convert it to a valid DOM id so that it can be used to dynamically build an HTML element with jQuery.
For example:
- Given:
some.user@example.com
- Returns:
some-user-at-example-com
- For:
$('<div />').attr('id, 'some-user-at-example-com');
Somewhat like the Rails parameterize method. What's a clean, simple way to do this?