blackdevil,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.active {
background: #FFCC00;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function() {
var id = "1,2,3".split(",");
if (id.length) id.forEach(function(item, i, id) {
jQuery("#item-" + item).toggleClass("active")
})
});
</script>
</head>
<body>
<div id="item-1">1</div>
<div id="item-2" class="active">2</div>
<div id="item-3">3</div>
</body>
</html>