I recently came across a code that I am interested in using on my form to automatically select an option when clicking on a div.
$("div").on("click", function(e) {
var $select = $("select");
$select.val($(this).data("value"));
// simulate click:
$select.find(":selected").click();
});
However, I have multiple select boxes in my form. Is there a way to incorporate a class from my select box into this code?