I want to add EventListener for .author_show class to change .author styles... this is my code
<div class="post>
<div class="post-cont>
// Some text
<div class="author_show"></div>
<div class="author_show"></div>
// Some text
</div>
</div>
<div class="authors">
<div class="author"></div>
<div class="author"></div>
</div>
<script type="text/javascript">
var author_show = document.getElementsByClassName("author_show");
var authors = document.getElementsByClassName("author");
for(var i=0;i<authors.length;i++)
{
author_show[i].addEventListener("mouseover",function(){
authors[i].style.display = "block"; // Problem
})
}
</script>
Thanks...