Calculation without refresh

I want to make the following calculation page (like shopping card).
My customers need to pay 99$ setup fee and the hosting for the 1st year will be free.
If they select 2 or more years (with dropdown menu, max 10 years), it needs to calculate 30$ per each year (need to calculate with jquery or something without refresh).

Setup: 99$
Years: 1
Total: 99$

Example 2:
Setup: 99$
Years: 2
Total: 129$

I hope you can help me :)
Who is Participating?
ggeekConnect With a Mentor Commented:
Here is the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<script src=""></script>

  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
<div id="total">99</div> 
    $("select").change(function() {
    var num = $("select").val();
    var total = 99 + (num - 1) * 30 + "";

Open in new window

QuantumBGAuthor Commented:
Thank you!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.