Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Java script within html and alerts within another page

**********Hello my name is Kevin i;m currently working on a test where I'm supposed to have html,java script,css and on the test im supposed to have the total number of questions i got right show up another page as an alert saying you got (? right)**** right now i only have it so the other page shows up but i shows up blank and i just want an alert to pop saying i got "?" right. feel free to edit my code and add of take anything away all help counts thank you.******

// Just so everything isn't global.
var App = function (myNameSpace) {
  var result = 0; 
  
  window.myCorrectAnswer = function() { // Global for the mark up to access it.
    alert(`Congrats, You got it right! \n Total of ${(++result)} correct`)
  }

  window.myWrongAnswer = function () { // Global for the mark up to access it.
    result--; 
    alert("Congradulations, You got it wrong! Try again!")
  }

  myNameSpace.launch = function () {
    console.log('Launching App');
  };

  return myNameSpace;
}({});

App.launch();
 a {
  text-decoration: none;
  display: inline-block;
  padding: 8px 16px;
}

a:hover {
  background-color: #ddd;
  color: black;
}

.previous {
  background-color: #f1f1f1;
  color: black;
}

.next {
  background-color: #4CAF50;
  color: white;
}

body,
html {
  height: 100%;
  margin: 0;
  font-family: Oswald;
}

.hero-image {
  /* the gradient deals with the shadowing on the pictures */
  /* DONT FORGET TO SEND THE PICTURE TITLED PHOTOGRAPHER WHEN SENDING THE WEBSITE LINK */
  background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.4)), url("download.jpg");
  height: 50%;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  position: relative;
}

.hero-text {
  text-align: center;
  position: absolute;
  /* DO NOT mess with the position, it will mess everything up!*/
  top: 50%;
  left: 50%;
  /* the trasform thing represents the longitude and latitude of the cover photo */
  transform: translate(-50%, -40%);
  color: white;
}
<! doctype html>

<head>
  <meta name="viewport" content="width=device-width, initial-scale=1">
</head>

<body bgcolor="D3D3D3">
  <font size=4>
    <font color="black">
      <div class="hero-image">
        <div class="hero-text">
          <h1 style="font-size:50px">Chemistry Unit 1-2 Review</h1>
        </div>
      </div>
      <br>
      <h1 align="center">Unit 1: Numbers and Energy Levels</h1>
      <h2>1)Numbers</h2>
      <img src="aadp.jpg" style="width:700px;height:200px;">
      <h2>Which example would accuracy be?</h2>
      <input type="radio" name="radiobutton1" onclick="myWrongAnswer();"> A<br><br>
      <input type="radio" name="radiobutton1" onclick="myWrongAnswer();"> B<br><br>
      <input type="radio" name="radiobutton1" onclick="myWrongAnswer();"> C<br><br>
      <input type="radio" name="radiobutton1" onclick="myCorrectAnswer();"> D<br><br>

      <h2>From the picture above, what example would presicion be?</h2>
      <input type="radio" name="radiobutton2" onclick="myWrongAnswer();"> A<br><br>
      <input type="radio" name="radiobutton2" onclick="myCorrectAnswer();"> B<br><br>
      <input type="radio" name="radiobutton2" onclick="myWrongAnswer();"> C<br><br>
      <input type="radio" name="radiobutton2" onclick="myWrongAnswer();"> D<br><br>

      <h2>What is 53mm in scientific notation?</h2>
      <p font size="12">*Formula: Divide number higher than 0 by 12 to get decimal.</p>
      <input type="radio" name="radiobutton3" onclick="myCorrectAnswer();"> 5.3<br><br>
      <input type="radio" name="radiobutton3" onclick="myWrongAnswer();"> 530<br><br>
      <input type="radio" name="radiobutton3" onclick="myWrongAnswer();"> 0.053<br><br>
      <input type="radio" name="radiobutton3" onclick="myWrongAnswer();"> 5.0003<br><br>

      <h2>How many milligrams in a Kilogram?</h2>
      <p font size="12">*Formula: K,H,D,U,C,M,M<br> Dont forget about moving the decimal points when dealing with decimals.<br> Also when dealing with non decimal numbers you add zeros.<br>
        <input type="radio" name="radiobutton4" onclick="myWrongAnswer();"> 1.000<br><br>
        <input type="radio" name="radiobutton4" onclick="myWrongAnswer();"> .1000<br><br>
        <input type="radio" name="radiobutton4" onclick="myCorrectAnswer();"> 1000<br><br>
        <input type="radio" name="radiobutton4" onclick="myWrongAnswer();"> 1000.<br><br>

        <h2>How many sigfigs are in the number 100,000?</h2>
        <p font size="12">Remember the 5 rules.<br> Non-zero digits are always sigfigs.<br>
          <font color="red">(decimal)</font>Any zeros in the middle of the numbers are sigfigs.<br>
          <font color="red">(decimal)</font>Any zeros before the number are not sigfig<br>
          <font color="red">(decimal)</font>Any trailing zeros<br>
          <font color="red">(decimal)</font>Count any zeros in the decimal place.<br>
          <input type="radio" name="radiobutton5" onclick="myCorrectAnswer();"> 1<br><br>
          <input type="radio" name="radiobutton5" onclick="myWrongAnswer();"> 3<br><br>
          <input type="radio" name="radiobutton5" onclick="myWrongAnswer();"> 6<br><br>
          <input type="radio" name="radiobutton5" onclick="myWrongAnswer();"> 5<br><br>

          <h2>2)Energy Levels</h2>
          <p font size="12">*Formula: 1s,2s,2p,3s,3p,3d,4s,4p,4d,4f</p>
          <h2>What are the second sublevels called and how many orbitals do they have?</h2>
          <input type="radio" name="radiobutton6" onclick="myWrongAnswer();"> 1s(7),2s(5),2d(3)<br><br>
          <input type="radio" name="radiobutton6" onclick="myWrongAnswer();"> 3s(2),3p(6),3d(10)<br><br>
          <input type="radio" name="radiobutton6" onclick="myWrongAnswer();"> 1s(1)<br><br>
          <input type="radio" name="radiobutton6" onclick="myCorrectAnswer();"> 2s(2),2p(6)<br><br>

          <h2>What is the definition of Electrons</h2>
          <input type="radio" name="radiobutton7" onclick="myWrongAnswer();"> Positive<br><br>
          <input type="radio" name="radiobutton7" onclick="myWrongAnswer();"> Neutral<br><br>
          <input type="radio" name="radiobutton7" onclick="myCorrectAnswer();"> Negative<br><br>
          <input type="radio" name="radiobutton7" onclick="myWrongAnswer();"> Flagella<br><br>

          <h2>What is the definition of Protons</h2>
          <input type="radio" name="radiobutton8" onclick="myWrongAnswer();"> Cellwall<br><br>
          <input type="radio" name="radiobutton8" onclick="myWrongAnswer();"> Production<br><br>
          <input type="radio" name="radiobutton8" onclick="myWrongAnswer();"> Produce<br><br>
          <input type="radio" name="radiobutton8" onclick="myCorrectAnswer();"> Positive<br><br>

          <h2>What was Pauli Exclusion about?</h2>
          <input type="radio" name="radiobutton9" onclick="myWrongAnswer();"> Each orbital can only hold up to 6 electrons<br><br>
          <input type="radio" name="radiobutton9" onclick="mCorrectAnswer();"> Each orbital can only hold up to 2 electrons<br><br>
          <input type="radio" name="radiobutton9" onclick="myWrongAnswer();"> Each orbital can only hold 3 electrons<br><br>
          <input type="radio" name="radiobutton9" onclick="myWrongAnswer();"> Each orbital can only hold 1 electrons<br><br>

          <h2>What was Aufbau's Principle?</h2>
          <input type="radio" name="radiobutton10" onclick="myWrongAnswer();"> Fill the highest level before the lowest<br><br>
          <input type="radio" name="radiobutton10" onclick="myCorrectAnswer();"> Fill the lowest level before the highest<br><br>
          <input type="radio" name="radiobutton10" onclick="myWrongAnswer();"> Fill the middle level before the anything<br><br>
          <input type="radio" name="radiobutton10" onclick="myWrongAnswer();"> Fill in all the levels then subtract what is not needed<br><br>

          <h1 align="center">Unit 2: Nomen Clature and Periodic Tables</h1>
          <h1>3)Noman Clature</h1>
          <h2>What is the noman clature used for MgCl2?</h2>
          <input type="radio" name="radiobutton11" onclick="myCorrectAnswer();"> Magnesium Dichloride<br><br>
          <input type="radio" name="radiobutton11" onclick="myWrongAnswer();"> Magnesium Chloride 2<br><br>
          <input type="radio" name="radiobutton11" onclick="myWrongAnswer();"> Magnesium 2 Chloride<br><br>
          <input type="radio" name="radiobutton11" onclick="myWrongAnswer();"> Magnesium 2 Dichloride<br><br>

          <h2>What is the noman clature used for 3?</h2>
          <input type="radio" name="radiobutton12" onclick="myWrongAnswer();"> -Mono<br><br>
          <input type="radio" name="radiobutton12" onclick="myCorrectAnswer();"> -Tri<br><br>
          <input type="radio" name="radiobutton12" onclick="myWrongAnswer();"> -Di<br><br>
          <input type="radio" name="radiobutton12" onclick="myWrongAnswer();"> -Hepta<br><br>

            <br>
            <br>
            <br>
            <br>
            <br>
            <a href="finalendpage.html" class="next" onclick="myCorrectAnswer();">Submit</a></p>
</body>

</html>

uiz i have to display what score i got but on another page as an alert but i don"t have a clue on how to do that part

Comments