const selectElement document querySelector sel1 selectElement addEvent

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
const selectElement = document.querySelector('#sel1');
selectElement.addEventListener('change', (event) => {
event.preventDefault();
event.stopPropagation();
var selind = document.getElementById("sel1").options.selectedIndex;
var $detailDiv = $('#partial'),
url = document.getElementById("sel1").options[selectElement.selectedIndex].getAttribute('imagepath');
$.get(url, function(data) {
$detailDiv.html(data);
});
});