I'm doing a course in JavaScript and I have the following problem:
In the same html file I have a function and in turn the html code that consists of a series of options which allows me to select day, month and year, it runs well without any problem in the browser.
My problem lies in separating the codes, and when wanting to execute the JavaScript code from an external file, I do not know how to invoke the function within the selected
, as it is done correctly when everything is inside from the same file.
I have tried to create a file with createElement
, but it does not work the same to me and I am wrong so I come to you to help me please.
I leave a file codepen for a better compression of the file.
Greetings and thanks for your help.