I have a string:
var html = '<select">\
<option></option>\
<option>Mr</option>\
<option>Mrs</option>\
<option>Ms</option>\
<option>Master</option>\
<option>Miss</option>\
<option>Dr</option>\
<option>TBA</option>\
</select>';
I'm wanting to place a selected
within the 'Master' option. How could I do this?
I've tried:
var html = $($(html).find("option").filter(function () { return $(this).html() == "Master"; }).prop('selected', true));
I don't know how to search a string like I would the DOM.