Create a valid HTML4 ID from an input value.
$ npm install html4-id
var idify = require('html4-id');
idify('This is a test!'); // Returns "this-is-a-test"
<script src="node_modules/html4-id/dist/html4-id.min.js"></script>
<div id="{{idify('This is a test!'}}"></div> <!-- Has the ID "this-is-a-test" -->
Removes invalid characters and generates an id meant to be used for HTML elements. See MDN for the note about invalid characters.