Basically I did the palindrome test and now I’d like to save it in an HTML file and send it to someone, the thing is I redid the whole thing again on microsoft visual studio code, and when I save it I get 3 different files, html, css and javescript.
is there anyway to combine all 3 into one html file so the webpage works?
What do you mean by “when I save it I get 3 different files”?
For what you’re trying to do, it does make sense to have everything in one HTML file: that’s perfectly reasonable for the small things you’re building here.
But that’s up to you here: as @hateoas says, you just use <script> and <style> tags, which is why I’m asking the question above. VS Code is just a text editor, you edit some text and the text is in a file. How, when you’re saving it, do you end up with three files?
I mean, you have 1 html file, 1 css file and 1 JS file that you link to the html file. When I save I just get 3 different files. Is that not how it works? It’s my first time using a coding program so maybe I did it wrong?
What I mean is that the program you are using is a text editor: you open or create a file, call it whatever you want, and write/edit some text in it.
There are tools that can combine files. And the text editor you’re using has the concept of plugins, which add functionality to it.
But if you have three files, then when you edit and save each one, you still have three files. A text editor is just like the notepad program on windows (or, say, a notes app on your phone), with some extra bells and whistles that help when writing code (rather than arbitrary text).
So if you want one [HTML] file, you need to write one file. So you can just take your HTML, then copy the JS into a <script> tag, and the CSS into a <style> tag
<!DOCTYPE html>
<html lang="en">
<head>
<style>
/* Your CSS styles here */
</style>
</head>
<body>
<!-- Your HTML content here -->
<script>
// Your JavaScript code here
</script>
</body>
</html>