Error "Uncaught ReferenceError: $ Is Not Defined" June 15, 2022 Post a Comment I began to study the 'javascript'. in html source code Solution 1: You need to include jQuery. Try adding this to your <head>: <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> Copy Solution 2: $ is an alias for the jQuery library. In this case, you don't need jQuery at all. You can just execute that IIFE (immediately-invoked function expression) and it should work fine. "use strict"; (function() { document.getElementById("test_button").onclick = test_click; function test_click() { document.getElementById("test").innerHTML = "HI"; } })();Copy <!Doctype html> <html> <head> <meta charset="utf-8"> </head> <body> <button id="test_button">Test</button> <p id="test">Hello World</p> <!-- script --> <script src="test.js"></script> </body> </html>Copy Share Post a Comment for "Error "Uncaught ReferenceError: $ Is Not Defined""
Post a Comment for "Error "Uncaught ReferenceError: $ Is Not Defined""