Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div class="row">
	<div class="form-group col-md-9 servicename">
		<select id="service" name="service" class="form-control servicelist">
			<option value="">Select Service</option>
			<option data-price=1.00 value='Service 1'>Service 1</option>
			<option data-price=2.00 value='Service 2'>Service 2</option>
		</select>
	</div>
	<div class="col-md-3">
		<input type="text" name="Price" class="form-control form-control-border text-right price-input-service" readonly>
	</div>
</div>
<div class="row">
	<input type="button" value="Add To List" class="btn btn-primary submit1" id="submit1" />
</div>

<div class="row">
	<div class="form-group col-md-9 partname">
		<select id="part" name="part" class="form-control partlist">
			<option value="">Select Part</option>
			<option data-price="0.00" value="None Needed">None Needed</option>
			<option data-price=1.00 value='Part 1'>Part 1</option>
			<option data-price=2.50 value='Part 2'>Part 2</option>
		</select>
	</div>
	<div class="col-md-3">
		<input type="text" class="form-control form-control-border text-right price-input-part" readonly>
	</div>
</div>
<div class="row">
	<input type="button" value="Add To List" class="btn btn-primary submit2" id="submit2" />
</div>
<div class="row">
	<table id="table1" class="table table-stripped table-bordered mt-3">
		<colgroup>
			<col width="65%">
			<col width="25%">
		</colgroup>
		<thead>
			<tr class='bg-gradient-dark text-light'>
				<th>Service Name</th>
				<th>Service Cost</th>
			</tr>
		</thead>
		<tbody></tbody>
	</table>
	<table id="table2" class="table table-stripped table-bordered mt-3">
		<colgroup>
			<col width="65%">
			<col width="25%">
		</colgroup>
		<thead>
			<tr class='bg-gradient-dark text-light'>
				<th>Part Name</th>
				<th>Part Cost</th>
			</tr>
		</thead>
		<tbody></tbody>
	</table>
</div>
<div class="row">
	<div class="col-lg-12">
		TOTAL AMOUNT HERE (WANT TO HAVE TOTAL AMOUNT OF EACH TABLE ROW FROM BOTH TABLE 1 AND 2 DISPLAYED HERE)
	</div>
</div>
              
            
!

CSS

              
                
              
            
!

JS

              
                $("#submit1").click(function () {
	{
		var selected = $(".servicelist");
		selected.each(function () {
			$("#table1").append(
				"<tr><td>" +
					$(this).val() +
					"</td>" +
					"<td>" +
					$("#service option:selected").attr("data-price") +
					"</td></tr>"
			);
		});
	}
});

$("#submit2").click(function () {
	{
		var selected = $(".partlist");
		selected.each(function () {
			$("#table2").append(
				"<tr><td>" +
					$(this).val() +
					"</td>" +
					"<td>" +
					$("#part option:selected").attr("data-price") +
					"</td></tr>"
			);
		});
	}
});
$(".servicename").on("change", function () {
	$(".price-input-service").val($(this).find(":selected").data("price"));
});
$(".partname").on("change", function () {
	$(".price-input-part").val($(this).find(":selected").data("price"));
});

              
            
!
999px

Console