There are two ways to do that:
Option 1. CSS + JS
CSS (class not to be applied beforehand)
.flipDivIn {
-webkit-transform: rotate3d(0, 1, 0, 180deg);
-moz-transform: rotate3d(0, 1, 0, 180deg);
transform: rotate3d(0, 1, 0, 180deg);
}
JS
document.getElementById('#flipDiv').addEventListener(event,function(e){
e.currentTarget.className += 'flipDivIn';
});
Option 2. JS only
document.getElementById('#flipDiv').addEventListener(event,function(e){
var tS = e.currentTarget.style;
tS.WebkitTransform = tS.MozTransform = tS.transform = 'rotate3d(0, 1, 0, 180deg)';
});
The keyword event will be replaced by the event of your choice (e.g. 'click').
If you want to use an event on another tag, than use this:
anyElement.addEventListener(event,function(){
var tS = document.getElementById('#flipDiv').style;
tS.WebkitTransform = tS.MozTransform = tS.transform = 'rotate3d(0, 1, 0, 180deg)';
});