I'm creating html in javascript with jquery, which I will then set values and inject into the dom.
See simple example below:
var $html = $('<div><select class"target"><option value="1">1</option><option value="2">2</option><option value="3">3</option></select></div>');
$html.find('.target').val('2');
$('body').html($html.prop('outerHTML'));
However this does not work (it does work for text inputs).
Any suggestions?