How to declare a variable, I think global, the way I declare in an html file and then use it in a js file (included by <script> tags)?
How to declare a variable, I think global, the way I declare in an
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
So as I understand, you want to use a variable from an HTML file in a JS file? To pass a variable from an HTML file to a javascript file, pass it with a function:
HTML.html
Javascript.js