Change IMG SRC based on dropdown option selected

Code with C | Programming: Projects & Source Codes Forums Javascript/AngularJS Change IMG SRC based on dropdown option selected

This topic contains 1 reply, has 1 voice, and was last updated by  CWC 1 year, 9 months ago.

  • Author
    Posts
  • #12498

    Amit
    Member

    Probably an easy one, but I’m not sure how to do it right now, as i’m currently looking for tutorials already.. So I hope someone wants to help me out.

    I’ve pasted the relevant code in there.

    What I want to achieve: There are two dropdowns. The option selected of the second drop down will change the src of the image.

    The best thing to happen i’d say would be something like

    or something.. Or just in simple words, just as in the comment in JSfiddle: The best option is that the name of the selected dropdown option (SECOND ONE), such as ‘WN.000.019’ (+.png) will be the new SRC.

    I hope someone could help.

  • #12499

    CWC
    Keymaster

    I think something like this might help you out.

    When working with drop down boxes it’s better to use change, as it will only fire when the dropdown value actually changed

You must be logged in to reply to this topic.