I have three elements, which are sliding on the screen, i want to get the text of element which is currently showing on the screen, I tried .text() function, but this returns the text of all the s elements, is there any way using javascript or jquery to do this.
<div id="text"> <span style=" font-size:100px;text-align:center;">koko</span> <span style=" font-size:100px;text-align:center;">abc</span> <span style=" font-size:100px;text-align:center;">efh</span> </div> $(document).ready(function(){ $('#text').mouseover(function(){ var txt = $('#text span').text(); alert(txt); }); });