Ну и типа окончательный вариант...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=windows-1251' />
<script src='http://code.jquery.com/jquery-latest.js'></script>
<!--
<script src="https://code.angularjs.org/1.3.9/angular.min.js"></script>
<script src="https://code.angularjs.org/1.3.9/angular-route.js"></script>
-->
<style type='text/css'>
.circle {
border: 1px solid red;
}
.Namber1 {
color: red;
}
.Namber2 {
color: green;
}
.Namber3 {
color: blue;
}
</style>
<script type='text/javascript'>
$(function(){
$('#full > div').click(function(){
var o1=$(this);
if (o1.hasClass('circle')) {
return;
};
var e1=o1.get(0);
var o2=o1.parent().find('.circle');
if (o2.length==0) {
o1.addClass('circle');
return;
};
o2.removeClass('circle');
o1.addClass('circle');
var e2=o2.get(0);
var c1=e1.className.match(/Namber\d+/)[0];
var c2=e2.className.match(/Namber\d+/)[0];
alert(c2+'<->'+c1);
o1.removeClass(c1);
o2.removeClass(c2);
o1.addClass(c2);
o2.addClass(c1);
});
});
</script>
</head>
<body>
<div id="full">
<div class="square Namber1">1</div>
<div class="square Namber2">2</div>
<div class="square Namber3">3</div>
</div>
</body>
</html>