<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- <script src="../js/jquery.js"></script> -->
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<title>Document</title>
<script>
$(function(){
// $("select[name="mySelect"]").on("change",(e)=>{
$("-sharpaa").on("change",(e)=>{
console.log(1111);
console.log("value", $("-sharpaa").val());
console.log("e",e.target.value);
let this_val = $(this).children("option:selected").val();
console.log("this_val",this_val);
});
})
</script>
</head>
<body>
<select name="mySelect" id="aa">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
</select>
</body>
</html>
my select chose not to get the current obtained value through $(this). Later, I read online that I asked for $(this). Children ("option:selected");
but I don"t know why it"s always undefined?