A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

DavidUsa

  • one year ago

WEB DEV JS AND PHP

  • This Question is Open
  1. DavidUsa
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    Hi. I am starting to program dots and boxes. The rest of my website is written in php html and css. However, for this part I will need css. How do I write the js? Where do I put it?

  2. DavidUsa
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 1

    @rsmith6559

  3. osanseviero
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    You have a file with css. It is the same with javascript. You just have to add it at the end of the file instead of the header

  4. woodrow73
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Here's a skeleton for you, where css can be placed inside the head, and javascript at the bottom of the body. `<!doctype html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>title</title> <style type="text/css"> #box { background-color: blue; width: 100px; height: 100px; } </style> </head> <body> <div id="box"></div> <script type="text/javascript"> document.getElementById("box").onclick = function() { alert("you clicked"); } </script> </body> </html>` You can even keep the files separate, and just reference to them like so; `<!doctype html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title>title</title> <link rel="stylesheet" type="text/css" href="url.css" /> </head> <body> <div id="box"></div> <script type="text/javascript" src="url.js"></script> </body> </html>`

  5. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.