/** * layer-drop-down box binding change event * */ $(document).on('change', '#ruleType', function() { var val = $ (this) .val (); $("#hideRuleTypeId").val(val);// Assign the selected value to the hidden box }); /** * layer-add-add binding click event * */ $(document).on('click', '#addRuleOrTransform', function() { alert($("#hideRuleTypeId").val());// Get the value in the hidden box, which is the value selected in the drop-down box });