Is there a way to get html files using javascript like getting element Id in DOM | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is there a way to get html files using javascript like getting element Id in DOM

Getting html with javascript

28th Jan 2020, 9:34 PM
Amasa Abubakar
Amasa Abubakar - avatar
3 Answers
+ 2
I think ... document.getElementsByTagName(‘html’)[0] would work.
28th Jan 2020, 10:32 PM
Ginfio
Ginfio - avatar
+ 1
If you mean a file, there are <input type="file" > Otherwise use Node.js fs module
28th Jan 2020, 11:10 PM
Gordon
Gordon - avatar
+ 1
Yes. But you should learn ES6 first. Then promises. Learn Ajax and fetch API.
29th Jan 2020, 3:31 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar