Multiple Actions for Rollover



Write a javascript code to perform Multiple actions for rollover.


<html>
  <head>
    <script>

        function display1()
        {
            document.fruit.src='Apple.jpg';
            document.getElementById("para").innerHTML="Trees of apple are larger than trees of pineapple.";
        }

        function display2()
        {
            document.fruit.src='Pineapple.png';
            document.getElementById("para").innerHTML="Trees of pineapple are smaller than trees of apple.";
        }

    </script>
  </head>
<body>

         <h2>Image Rollover</h2>
         <a onmouseover="display1()">
         <h3>Apple</h3>  </a>
        
         <a onmouseover="display2()">
         <h3>Pineapple</h3> </a>
         
         <a> <img src="Apple.jpg" name="fruit" ></a>
         <p id="para">Trees of apple are larger than trees of pineapple</p>
         
  </body>
</html>

Output: