I personally use a hyphen-separated naming convention which prefixes class names, IDs, data properties, etc with an abbreviated identifier of the entity which owns the code, and one for the area of functionality.
If I were working on a chart program for company Foo, my prefix might be:
foo-chart-
This allows me to make all company identifiers unique to the company, and areas of code unique to each other (so as to avoid colliding with other devs in other areas of functionality).
Contrived example:
<button id="foo-chart-refresh" class="foo-chart-interact" data-foo-chart-last="201205031421">Refresh Chart</button>
<script type="text/javascript">
var lastRefresh = $('#foo-chart-refresh').data('fooChartLast'); // see docs on .data() for case/hyphenation handling
</script>
I find using a hyphen fits well with almost any place my identifiers would be needed--either as a markup attr value or name, or in code, etc. You could use any char which fits your needs (. is very common)