I am working within miva system so lets just say its a nightmare. I have the following code that I have to work with
<select name="ShippingMethod">
<option value="mvfedexsoap:FEDEX_2_DAY">FedEx 2Day® ($15.91)</option>
<option value="mvfedexsoap:GROUND_HOME_DELIVERY">FedEx Home Delivery® ($13.36)</option>
<option value="mvfedexsoap:PRIORITY_OVERNIGHT">FedEx Priority Overnight® ($20.15)</option>
<option value="mvfedexsoap:STANDARD_OVERNIGHT">FedEx Standard Overnight® ($18.41)</option>
</select>
My only option within this store is to work with jquery. I am fairly new to jquery so I would appreciate any help you are willing to give me.
On page load I want it to select the cheapest option. The method I was thinking of was to somehow collect the text within the option parse out the price then compare and select the lowest value. If you have something that may help I thank you ahead of time.
Try this jsFiddle example.
Basically this loops through the option text values, splits them and parses them into floating points, then finds the lowest value and selects it.