Sten Ka Razin Sten Ka Razin - 6 months ago 54
Javascript Question

image picker preselect item on initialization

I'm using image-picker from and I would like to preselect an image during the page load. I've tried this:

$('#image_picker option[value="54fdada12476"]').prop('selected',true);


But doesn't work. Also tried selected option for image-picker and jquery attr(). Is there an easy way to select by value?



Ok, got it:


this selects the desired option