如何用JavaScript函数调用jQuery函数?
要使用JavaScript函数调用jQuery函数,请尝试以下代码。
<!DOCTYPE html> <html> <body> <script src="https://cdn.staticfile.org/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>