How to call jQuery function with JavaScript function?

jQueryWeb DevelopmentFront End Technology

To call jQuery function with a JavaScript function, try the following code.

 Live Demo

<!DOCTYPE html>
<html>
   <body>
      <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
      <script>
         $.myjQuery = function() {
            alert("jQuery");
         };
         $(document).ready(function() {
            alert("Welcome!");
         });
         function display() {
            $.myjQuery();
         };
      </script>
      <input type="button" value="submit" onclick=" display();">
   </body>
</html>
raja
Published on 30-Jan-2018 16:22:08
Advertisements