"What is the basic code....for a webpage?"
Note that, generally, for scripts, it would be setup like this:
<!--CODE ABOUT THE PAGE GOES HERE, like title info, scripts, css (formatting),
and other special tags that do things, like set the page to refresh-->
<body><!--note that things like a background go inside the body tag itself
like <body bgcolor="#00000"> for black.>-->
<!--PAGE CONTENT GOES HERE... text, images, forms, and pretty much everything else that isn't setting up something.-->
<script> YOURSCRIPTHERE </script>
the rest of the script can go here, like the image it makes, or the menu it makes, or text, or whatever.