0

Hi i have a textarea. Text area is to enter label names. When i enter first letter of the label name the matching labels appear as dropdown so that they can select the label from the drop down instead of typing the whole name. This drop down is a div.

Now i need to hide the div when i click elsewhere on the document except on the dropdown. how can i achieve this?

I tried with onblur on the textarea but there is a pronblem with that. the problem is when drop down appears there will be list of tags in the drop down. now i have to capture the clicked tag from drop down but as onblur is geting fired the drop down is getting hiden and onclick event on the labels is not working. In the drop down every label is a div.

Thanks in advance for helping?

2
Contributors
2
Replies
10
Views
3 Years
Discussion Span
Last Post by yaragalla_mural
0

Now i need to hide the div when i click elsewhere on the document except on the dropdown. how can i achieve this?.

With some jQuery, you should be able to accomplish this. This isnt tested, but should give you the general idea...

$('html').click(function () {
     $("#div1").hide();
});

Edited by JorgeM

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.