I am working on a project that involves an HTML section where a user can choose a billing term from a drop-down list. I am in the process of writing JavaScript code to capture the selected option value and use it in another part of the webpage.
Here is a snippet of my HTML:
<div class="payment-term">
<label>Billing period:</label>
<select id="billing-price" name="billing-term" class="selectpicker">
<option value="200">12 Months: $200/mo. (Save 20%)</option>
<option value="250">1 Month: $250/mo.</option>
</select>
</div>
<div class="card-charge-info">
Your card will be charged $<span id="payment-total"></span> now, and your subscription will bill $<span id="payment-total"></span> every month thereafter. You can cancel or change plans anytime.
</div>
This is the initial Javascript code that I have started:
var e = document.getElementById("#payment-term");
var stringPmt = e.options[e.selectedIndex].value;
You can view the progress in my JSFIDDLE here: http://jsfiddle.net/rynslmns/DcJ4f/1/