$("#myDiv").toggle($("#drop1").val() === $("#drop2").val());
Explanation: $("#dropX").val()Gets the value of the selected item in this drop-down menu; ===compares them, giving trueor falseas necessary; and $("myDiv").toggle(...)shows or hides #myDivdepending on the passed value.
If you want to do this when changing the value, wrap it in $("#drop1, #drop2").change(function () { ... });as in nickf's answer.
source
share