Sten Ka Razin Sten Ka Razin - 1 year ago 113
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?


Answer Source

Ok, got it:


this selects the desired option

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download