Created
January 14, 2013 16:33
-
-
Save bennick/4531323 to your computer and use it in GitHub Desktop.
unique products blog post on lemonstand, click listener example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inside of click event listener | |
// Get image file name that is stored as the img id | |
var code = $(img_element).attr('id'); | |
// Create an option and insert it into the select dropdown | |
$(product_option_select_dropdown).append("<option value='" + code + "'>" + code + "</option>"); | |
// Select the newly created option | |
$(product_option_select_dropdown).value = code; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment