Currently developing an HTML5 template known as
Londinium - responsive bootstrap 3 admin template
- In my dropdown menu, I have three items. When the user clicks on
Owned
, I am trying to display the hidden divcown
, but it is not showing up.
The drop-down menu utilizes Select2
jQuery to populate the list.
Dropdown Menu
<select id ="owner" data-placeholder="Select Ownership" class="select-full" >
<option value="" selected></option>
<option value="Owned">Owned</option>
<option value="Co-Owned">Co-Owned</option>
<option value="Consigned">Consigned</option>
</select>
Div for Display
<div id="cown" style='display:none'>
<div class="col-md-4" >
<label>Percentages</label>
<input type="text" placeholder="20" class="form-control">
</div>
</div>
Javascript Functionality
<script type='text/javascript'>//<![CDATA[
$(document).ready(function() {
$('#cown').hide();
$('#ownership').change(function () {
alert(('#ownership option:selected').text());
if ($('#ownership option:selected').text() == 'Owned'){
$('#cown').show();
}
else {
$('#cown').hide();
}
});
});
//]]>
</script>
Any suggestions on how to fix this script issue?
Download Theme folder Here * I am unable to attach a snippet due to multiple jQuery dependencies; the folder contains all necessary files