Why isn't my code working?


#1

I can’t get the Quiz button on this to work! Please help me!

<html><head>
        <meta charset="utf-8">
        <title>Final Project (Final or Ideas?)</title>
        <style>
            body{
                background-color:rgb(255, 0, 217);
                font-family:Trebuchet MS;
            }
            .firstp{
                background-color:rgb(0, 0, 0);
                color:rgb(0, 255, 9);
                font-family:Cursive;
            }
            .up{
                background-color:rgb(0, 0, 0);
                color:rgb(255, 255, 255);
                font-family:Comic Sans MS;
            }
        </style>
    </head>
    <body>
    <script>
    <script>
function myFunction() {
    alert("If the p tag is this <p>, what would a heading tag be if its h1?");
}
    </script>
<h1 id="intro">Maybe Final Project?!</h1>

<p class="firstp">Welcome to my Final Project! (maybe) I hope you enjoy it!</p>

<a href="#cmaa"><button>Code Messing Around Area</button></a><br>
<br>
<a href="#fp"><button>Final Project</button></a>

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<h2 id="fp">Final Project</h2>
<p>My final project will be a semi-interactive coding course for building webpages so people can learn to code them! So here it is! Without further ado, lets begin!</p>
<a href="#HTML"><button>HTML Course</button></a><br>
<a href="#CSS"><button>CSS Course</button></a><br>
<a href="#JS"><button>JS Course</button></a>
        <br>
<a href="#intro"><button class="up">Back to Main Menu</button></a>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<h2 id="HTML">HTML Course</h2>
        <p>Welcome to the HTML Course!This will teach you the basic HTML elements.</p>
        <h3>The Heading and Paragraph elements</h3>
    <p>The heading and paragraph tags are the basic text tags in HTML. HTML uses tags in their code to make things work. For example, you would have the paragraph tag, which would be p. Then put the carrot symbols around them.</p>
    <button onclick="myFunction()">Quiz</button>
    
    <p>The heading tags range from h1 to h6. h1 is the biggest and h6 is the smallest heading tag. The tags will be put below as an example starting with h1 throught h6 then p.</p>
    
    <h1>Heading 1</h1>
    <h2>Heading 2</h2>
    <h3>Heading 3</h3>
    <h4>Heading 4</h4>
    <h5>Heading 5</h5>
    <h6>Heading 6</h6>
    <p>Paragraph</p>

<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>

<h2 id="cmaa">Code Messing Around Area</h2>

<p>This is where I expierement with code I learned.<br> (I delete things afterward to have room for others)</p>

<a href="#intro"><button class="up">Back to Main Menu</button></a>

    
</body></html>

Issues with grid layout
#2

Not working because of this:

    <script>
    <script>
function myFunction() {
    alert("If the p tag is this <p>, what would a heading tag be if its h1?");
}
    </script>

You have two <script> tags, remove one and the function will work.


#3

aaah its all one page XD you fooled me there XD

i whas wondering why you used all those <br> tags XD


#4

Almost had a heart attack when I saw it, but hey, it’s the learning process still.


#5

Thanks =)

I just completely missed it…


#6

I used the
tags so people would hopefully not scroll down, but instead use the buttons. I might have a little bit too far though…


#7

This creates a problem for people with diffrent sizes of screens tho.

Have you thought about hiding/showing the content with javascript ?
You could set for example the css to display:none; / display:block; for the elements you want to show/hide.


#8

True. I could do that, but I wasn’t planning on it.


#9

Yea @biirra does have a point. There is like over a hundred of those <br> tags. That is a lot!


#10

Wow. I getting a lot of disclaimer from it. :laughing:

Maybe I will delete some or all. I don’t know…


#11

Its just things where you might want to reconsider your approach. Since a different approach could mean for more reliable/reusable/readable code.
This does not mean you should feel obligated to aply them.


#12

Yes! Don’t take it completely like you shouldn’t do it. Its your code, and you is you!


#13

You are missing the <script> tag.


#14

Thanks =)

I sorta already figured it out though.

Well, like I said, thanks!


#15

Your welcome! Ok, thanks for telling me.