Hide div
Hide div
- Started
- Last post
- 5 Responses
- kalkal
Does anyone know if it's possible to make a div hidden when a user clicks on any form element?
Thanks.
- Nathan_Adams0
jQuery:
$('input').click(function() {
$('#div-id').hide();
});
- Nathan_Adams0
And depending on your form, you may want to expand 'input' to include other non-input form elements like select, textarea, etc.
- ETM0
- kalkal0
Nathan, didn't appear to work. I used the div in which I'd like to hide (a menu that has absolute positioning provided with another jquery script which I don't think is conflicting) and it simply didn't do anything...
No errors in the console though
- orrinward20
What nathan has suggested should work.
Post a jsfiddle or codepen of your code?
- It's easier to fork a solution than to write one without context.orrinward2