As I am new to javascript:
I would like to change onmouseover one div id with another div id. On mouse out everything would go back. I was looking and tried this online for several hours with no luck.
Trying this:
<script>
$('.one').hover(
function() {
$('.two').attr('id', 'header-email'); //box two's ID becomes box one
$(this).attr('id', 'header-email2'); //box one's ID becomes box two
}, function() {
$('.two').attr('id', 'header-email2');
$(this).attr('id', 'header-email');
}); //end hover one
$('.two').hover(
function() {
$('.one').attr('id', 'header-email2'); //box two's ID becomes box one
$(this).attr('id', 'header-email'); //box one's ID becomes box two
}, function() {
$('.one').attr('id', 'header-email');
$(this).attr('id', 'header-email2');
}); //end hover one
</script>
my html:
<div id="header-email" class="one" style="visibility: visible;">textinhere<a href="mailto:tips@email.net">tips@email.net</a></div>
<div id="header-email2" class="two" style="visibility:hidden;">textinhere<span><br>sometext</span></div>
still no luck..