2

I'm passing a default value to the dropdown on page load but the following code does not display the image associated with the selected value on load. If I choose a value from the dropdown AFTER the page loads, the associated image displays as intended. How do I get the image to display when the default value is passed initially? Ideas?

$(document).ready(function(){

    $('form .primary_choices').dropkick({
       change: function (value, label){
            $('#firstChoice').html(<image src=@imagePath' + '/' + label.replace(' ', '_').replace(' ', '_') + '.jpg" />');
    }
    });
});
ADubb
  • 41
  • 5

0 Answers0