I’m looking to hide a submit button with a value of ‘foo’, but only if the div it resides within has a class of ‘foo2’.
The following jQuery does half the job, hiding the submit button if it contains ‘foo’ in its value, however it works across the board, if its within foo2 or not.
<script type="text/javascript">
$(document).ready(function () {
$("input[value=foo]").closest('div').hide();
});
</script>
Any ideas?
All you needed was to call the div with its class name