How to set the selected option for particular condition in Select?

How to set the selected option for particular condition in Select?

How to set the "selected" in Select option for particular condition?

My code:

<input id = "inputs" type = "text"/>
<select name="valueA" id="sss">
       <option value="$0" selected="selected">$0</option>
                        <option value="$500K" selected ="{!IF($('# inputs ').val()!= '','selected','')}">$500,000</option>
                        <option value="$1M">$1,000,000</option>
</select>  

Isn't working? How to check the if condition in inside of select option?