Quiz

by Rania Krourou

HTML

<form id="quizForm" method="post" onsubmit="quiz_function(); return false;">

  <br>
  <h1>
  Begin quiz:
  </h1>
  <br>
  Enter Name
  <input type="text" id="Name" value="">
  <div id="Name_result"></div>
  <br>
  <input type="submit" value="Submit">
  <label>

    <div class="section1">
      <p class="question1">1. What is your Zodiac Sign?</p>
      <ul class="answers1">
        <input type="radio" id="q1a" name="set1">
        <label for="q1a">Aries (March 21-April 19)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1b">Taurus (April 20-May 20) </label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1c">Gemini (May 21-June 20)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1d">Cancer (June 21-July 22)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1a">Leo (July 23-August 22)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1b"> Virgo (August 23-September 22)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1c">Libra (September 23-October 22)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1d">Scorpio (October 23-November 21)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1a">Sagittarius (November 22-December 21)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1b">Capricorn (December 22-January 19)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1c">Aquarius (January 20 to February 18)</label>
        <br/>
        <input type="radio" id="q1a" name="set1">
        <label for="q1d">Pisces (February 19 to March 20)</label>
        <br/>
        <br/>
      </ul>
    </div>

    <div class="section2">
      <p...

CSS

body {
  background-color: lAVENDER;
}

JavaScript

function quiz_function() {
  value = document.getElementById('Name').value;
  //window.alert(value)
  document.getElementById('Name_result').innerHTML = value;
}