If you want to check selected option through javascript
Simplest method is add onchange attribute in that tag and define a function in js file
see example if your html file has options something like this
<select onchange="subjects(this.value)">
<option>Select subject</option>
<option value="Computer science">Computer science</option>
<option value="Information Technolgy">Information Technolgy</option>
<option value="Electronic Engineering">Electronic Engineering</option>
<option value="Electrical Engineering">Electrical Engineering</option>
</select>
And now add function in js file
function subjects(str){
console.log(`selected option is ${str}`);
}
If you want to check selected option in php file
Simply give name attribute in your tag and access it php file global variables /array ($_GET or $_POST) see example if your html file is something like this
<form action="validation.php" method="POST">
Subject:<br>
<select name="subject">
<option>Select subject</option>
<option value="Computer science">Computer science</option>
<option value="Information Technolgy">Information Technolgy</option>
<option value="Electronic Engineering">Electronic Engineering</option>
<option value="Electrical Engineering">Electrical Engineering</option>
</select><br>
</form>
And in your php file validation.php you can access like this
$subject = $_POST['subject'];
echo "selected option is $subject";
this.selected
) that you should bypass using jQuery ($(this).prop("selected")
) but they will both work for you. – Resistless