html and JavaScript
I really need help. I am trying to use basic JavaScript and html to make a website for my stem class project. The only problem is that I can't figure out how to use JavaScript in my html code. I am aware of the script tags, but my JavaScript doesn't work with it. Let's say I was trying to draw a simple circle. I learned that, in JavaScript, a circle is
Here's my code so far:
(I've only been working with coding for about 6 months)
ellipse(x,y,width,height);
but it doesn't work.Here's my code so far:
<!DOCTYPE html>
ellipse(200,200,140,140);
(I've only been working with coding for about 6 months)
Comments
<!DOCTYPE html> css here html here
It looks to me like you're missing Head. Also not sure if I started off with "!DOCTYPE" in the html. I don't know how you're coding the website, so it might make a difference. Hope this helps in some way!
< canvas id=canvas1>< /canvas>
Then style it in css. You could add more tags but its cleaner this way
< style>
.canvas1 {
Height:100px;
Width:100px;
< /style>
}
Then I think it is easier to make shapes with html.
But with javascript you need a draw function.
That will let you see it.
Sorry if I said something wrong I haven't done this for a little bit.