identifier

Snippet: JavaScript: Create css class/id/name identifier cleanly from string

Based on
https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_html_id/7
https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_clean_css_identifier/7
this simple JavaScript snippets turns strings into valid HTML id / class / name identifiers (http://www.w3.org/TR/html4/types.html#type-name)

Code: