I am seeking a way to trigger the opening of this dropdown select not by directly clicking on its position, but rather by clicking on another <span>
.
Displayed below is the dropdown menu:
<div class="styled-select">
<span id="camDurationSpanId" style="font-size:18px; position: absolute; top:8px; width:305px; height :42px;"></span>
<select id="camDurationId" name="camDuration" style="margin:42px 0 0 5px; border: none" onmousedown="{this.size=this.options.length;} " onchange='this.size=0;' onblur="this.size=0;">
<option value="0">All Duration</option>
<option value="1">Last Month</option>
<option value="2">Last Two Weeks</option>
<option value="3">Last Week</option>
<option value="4">Custom</option>
</select>
</div>
To achieve this functionality, I want to be able to click on
<span id="camDurationSpanId">
and have the dropdown menu open. Additionally, I would like the selected option to be displayed within this span.
Below you will find the javascript code I am currently using:
$(function() {
$('#camDurationSpanId').click(function() {
$('#camDurationId'). //I am unsure of what should be written here
});
});
Could someone confirm if it is possible to achieve this desired behavior?