I need to take a value from select option and pass it to a load function.
function example_ajax_request2() {
$('#example-placeholder').html('<p><img src="LINK_TO_IMAGE" width="220" height="19" /></p>');
$('#example-placeholder').load("LINK_TO_HTML_FILE $('select#example1').val();");
}
And this is my selector:
<select id="example1" class="selectorM" size="4">
<option value="#video1" onclick="example_ajax_request2()">1</option>
<option value="#video2" onclick="example_ajax_request2()">2</option>
</select>
Here the video will be loaded:
<div id="example-placeholder">
<p>Placeholding text</p>
</div>
Why this is not working?
I need to pass the value from #video1 or #video2 to .load function
I try to get select example1 value with this code
$('select#example1').val();
Corect answer!
insted of
Thanks anyway! 🙂