What's the best method to output "selected" for my form select based on the URL parameter?
In my URL I might have this parameter &term=retail.
How could I tell the below code to select the retail option?
<select class="form-control" name="term" id="saleTerm">
<option value="all-residential" selected>All Residential</option>
<option value="apartment"> Apartment</option>
<option value="villa"> Villa</option>
<option value="all-commercial">All Commercial</option>
<option value="office"> Office</option>
<option value="retail"> Retail</option>
</select>