jquery: แสดง output

<!DOCTYPE html> 
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js">
</script>
<script>
$(document).ready(function()
{
     <!-- Event -- >
     $("#ok1").mouseenter(function()
     {
        <!-- Action -->
        $("#output").text("Mouse In");

     });
     
     <!-- Event 2 -->
     $("#ok1").mouseleave(function() 
     {
          <!-- Action -- >
          $("#output").html("<h1>Mouse Out</h1>");
 
     });
});
</script>

</head>

<body>

<button id=ok1>HOW2DEV.NET</button>

<p id=output></p>

</body>

</html>


Leave a Comment

Your email address will not be published. Required fields are marked *