I have a dropdown select boy with a few images.
I can get the images to load when the user changes value, but I want the View All to load right when the page is viewed.. I know I can do this a few different ways but I would prefer that it just loads right away since the value is specified.
$(document).ready(function() {
$("#image").change(function() {
$("#imagePreview").empty();
$("#imagePreview").append("<img src=\"" + $("#image").val() + "\" />");
});
});
<select name="image" id="image" class="inputbox" size="1">
<option value="imageall.jpg" selected> - All - </option>
<option value="image1.jpg">image1.jpg</option>
<option value="image2.jpg">image2.jpg</option>
<option value="image3.jpg">image3.jpg</option>
</select>
<div id="imagePreview">
</div>
Even if you view the Fiddle demo, you will see it won't load anything until you select image1 etc.
I want the imageall.jpg to load right when someone views fiddle.
thank you