I am using both click and blur event. Find my code at http://jsfiddle.net/CyQ2w/11/
When using only click event: everything works fines. A click on a list populates value in text area.
When using both click and blur: A blur event takes priority and prevents click event to trigger.
Blur event is used only to hide div when textarea loses focus.
I have read about binding this two events to an element. But, in my case, elements [anchor and textarea] a开发者_运维技巧re different.
Any help would be appreciated.
$(document).bind("click",".username", function() {
$("#message_board").val($("li.hovered div").text());
return false;
});
this one should help. Also i recommend you migration to newest jquery and to use .on method instead of .bind
精彩评论