How to change selected item in dropdown via clicking on an image (jquery)
I am using magento, but am far from jquery/javascript
I have a list of images that i want to be able to click and change the corresponding dropdown list selection.
I can have it set up so that select name/value or option value can be attached to each image that 开发者_JAVA百科corresponds either using class or id. So i just need the basic jquery to input
thanks a million
Say the id of the image is the value of the dropdown item.
$('img').click(function() {
$('#dropdown').val($(this).attr('id'));
});
JsFiddle Example
精彩评论