var classList = document.getElementById('divId').className.split(/\s+/);
for (var i = 0; i < classList.length; i++) {
if (classList[i].substr(0, 13) === 'color-scheme-') {
console.log(classList[i].substr(0, 14)); // ваше число
}
}
var classList = $('#divId').attr('class').split(/\s+/);
$.each(classList, function(index, class) {
if (class.substr(0, 13) === 'color-scheme-') {
console.log(class.substr(0, 14)); // ваше число
}
});
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<!--
<link rel="stylesheet" type="text/css" href="tmp.css" />
-->
<style type="text/css">
</style>
<script type="text/javascript">
$(document).ready(function(){
$('[id^="cola"]').each(function(){
alert(this.id)
});
});
</script>
</head>
<body>
<div id="fanta"></div>
<div id="colatmp"></div>
<div id="cola_fanta"></div>
<div id="cola_pepsi"></div>
<div id="pepsi"></div>
</body>
</html>