I have this piece of code:
function expandCollapse(hypId, ElemId, ShowText, HideText) {
var handler = function () {
$("#" + ElemId).toggle();
toggle(hypId, ElemId, ShowText, HideText);
}
$('#' + hypId).live('click', handler);
}
I want to make sure that no matter if this code is called for >1 time, it shouldn't do anything as long as the same hypId is being registered for click event. How do I do that?