uroboros7,
вариант ...
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
.article_selected {
background: #FFCC00;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>
$(function() {
var $li = $("ul#art_gen > li"),
id_selected = [];
$li.on({
click: function() {
$(this).toggleClass("article_selected");
id_selected = $.map($li.filter(".article_selected"), function(el) {
return el.id
});
alert(id_selected)
}
})
});
</script>
</head>
<body>
<ul id="art_gen">
<li id="1">1</li>
<li id="2">2</li>
<li id="3">3</li>
<li id="4">4</li>
<li id="5">5</li>
</ul>
</body>
</html>