<div></div>
<span>Щелкните правой<br/>кнопкой мыши по блоку</span>
div {
background: blue;
color: white;
height: 100px;
width: 150px;
}
div.contextmenu {
background: yellow;
color: black;
}
$(function() {
var div = $( "div:first" );
div.contextmenu(function() {
div.toggleClass( "contextmenu" );
});
});
This Pen doesn't use any external CSS resources.