title: Javascript change image on dropdown - missing image
body: <p>I have a small piece of JavaScript that changes an image based on a drop down. It currently works and changes the image as it should. Unfortunately if the image is not there it shows the missing image icon and I'd rather it kept the default image.</p>
  
  <p>My JavaScript is -</p>
  
  <pre><code>&lt;script&gt;
  $(function() {
      $("#input_1").change(function(){
          var selectedImage = $(this).find(':selected').val();
          val = $("#input_1 option:selected").text();
          $("a.lb:first").html( "&lt;img src=images/11_" + selectedImage + ".jpg&gt;");
          $('a.lb:first img').addClass( "img-fluid" );
  
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>My HTML is -</p>
  
  <pre><code>&lt;img src="images/11_1.jpg" alt="Objective Marker Bases" title="Objective Marker Bases" class="img-fluid"&gt;
  &lt;select name="id[1]" required="required" aria-required="true" id="input_1" class="form-control"&gt;
  &lt;option value="" selected="selected"&gt;--- Please Select ---&lt;/option&gt;
  &lt;option value="1"&gt;White&lt;/option&gt;
  &lt;option value="2"&gt;Yellow (+£1.00)&lt;/option&gt;
  &lt;option value="4"&gt;Blue&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>