Horje
pass value inside the js file using script tag Code Example
pass value inside the js file using script tag
I came across an idea as assigning an id to the <script> element and 
passing the arguments as data-* attributes. The resulting <script> tag would 
look something like this:

<script id="helper" data-name="helper" src="helper.js"></script>

The script could then use the id to programmatically locate itself and parse 
the arguments. Given the previous <script> tag, the name could be retrieved 
like this:

var name = document.getElementById("helper").getAttribute("data-name");

We get output name = helper




Javascript

Related
[myobj.key] [myobj[key]] [myobj["key"]] answer Code Example [myobj.key] [myobj[key]] [myobj["key"]] answer Code Example
next js material ui rtl direction Code Example next js material ui rtl direction Code Example
how to replace nan with a value in js Code Example how to replace nan with a value in js Code Example
js date remove am and pm Code Example js date remove am and pm Code Example
create a new tag when button click javascript Code Example create a new tag when button click javascript Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9