0

Here is my code. I have been trying to get the datepicker to work for a few hours now. In the dev tools, it gives me these 2 errors.

index.html:11 Uncaught ReferenceError: $ is not defined at index.html:11 (anonymous) @ index.html:11

jquery-ui.min.js:1 Failed to load resource: net::ERR_FILE_NOT_FOUND

Can you tell me what I'm doing wrong?

This is for school and I have not used javascript for 2 years so please be kind and don't just tell me to look harder I know this is simple, I'm just stuck.

<!DOCTYPE html>
<html lang="en-US">

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Sample Page Template</title>
  <!-- <link rel="stylesheet" href="/js/jquery-ui-1.12.1.custom/jquery-ui.min.css">
            <link rel="stylesheet" href="/styles/main.css" >
            <link rel="stylesheet" href="/styles/header.css">
            <link rel="stylesheet" href="/styles/assignment.css"> -->
  <script>
    $(function() {
      $("#date_of_purchase").datepicker();
    });
  </script>
</head>

<body>
  <header>
    <h1>Application Name</h1>
  </header>
  <main>
    <section>
      <div>
        <label for="email">Email:</label>
        <input type="text" id="email" name="email">
        <span></span>
      </div>
      <div>
        <label for="date_of_purchase">Date Of Purchase:</label>
        <input type="text" id="date_of_purchase" name="date_of_purchase">
      </div>
      <div>
        <label for="discount_type">Discount Type:</label>
        <select id='discount_type'>
          <option value="None">None</option>
          <option value="Military">Military</option>
          <option value="Student">Student</option>
          <option value="AARP">AARP</option>
        </select>
      </div>
      <div>
        <label for="purchase_amount">Purchase Amount:</label>
        <input type="text" id="purchase_amount" name="purchase_amount">
        <span></span>
      </div>
      <div>
        <input type="button" id="calculate" name="calculate" value="Calculate" class="button">
      </div>
      <div>
        <label for="discounted_price">Total:</label>
        <input type="text" id="discounted_price" name="discounted_price" disabled>
      </div>
    </section>
  </main>
  <script src="https://code.jquery.com/jquery-3.4.1.js"></script>
  <script src="/js/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
  <script src="js/purchase_discount.js"></script>

</body>

</html>
Not A Bot
  • 2,474
  • 2
  • 16
  • 33

0 Answers0