The source code failed because this syntax is invalid:
.children().("a")
The rest of the code also had some fundamental flaws. Try instead:
$(function () {
$('.buttons a').click(function (event) {
var $target = $(event.target);
var $li = $target.parent();
$li.addClass('selected').siblings().removeClass('selected');
});
});
In this amendment, the class selectedis applied to <li>-not a <a>- to provide more flexibility when writing CSS.