HTML Editor
<!DOCTYPE html> <html lang="en-US"> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <body> <h1>jQuery getScript() Method</h1> <p>Click on the button to alert.</p> <button onclick="myFunction()">Click Me</button> <script> $(document).ready(function(){ $.getScript("/script/alert-me.js"); }); </script> <p><strong>Note</strong>: Javascript file used in this example is <a href="/script/alert-me.js" target="_blank">alert-me.js</a></p> </body> </html>
OUTPUT
×

Save as Private