You could do it with css as alireza told you but you need an strict html code. The easiest way by far is jquery
and quite easy to implement and understand.
With this code:
$('.element').on('hover', function(){
$('.element').toggleClass('hover');
});
You just add the class hover
to whatever element with the class element
you hover. Then just add css properties to class hover
:
.hover {
color:red;
}
JSFIDDLE
Edited: after reading your comment... if you want a different hover
effect for each element then as easy as with this html:
<p class="element text">Text</p>
<p class="element icon"></p>
you just toggleClass
diferent class for element like:
$('.element').on('hover', function(){
$('.text').toggleClass('hover1');
$('.icon').toggleClass('hover2');
});
NEW JSFIDDLE
To add it to your project don't forget the script tag and on load function (jsfiddle does it automatically):
<script type="text/javascript">
$(document).ready(function () {
$('.element').on('hover', function(){
$('.element').toggleClass('hover');
});
});
</script>