Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to load javascript code to an html file at runtime?

Tags:

People also ask

How do I load a JavaScript script in HTML?

You can add JavaScript code in an HTML document by employing the dedicated HTML tag <script> that wraps around JavaScript code. The <script> tag can be placed in the <head> section of your HTML or in the <body> section, depending on when you want the JavaScript to load.

Where do I put JavaScript in HTML file?

JavaScript in <head> or <body> You can place any number of scripts in an HTML document. Scripts can be placed in the <body> , or in the <head> section of an HTML page, or in both.


Let me ask whether it is possible to load javascript code to an html file at runtime. For example , place a textbox to input the location of the script files and a form button to trigger loading the script files.

Thank you in advance.