if (IsBestanswer == "True")
{
$(bestAnswer).addClass('IsBestanswer');
$(bestAnswer).unbind('click');
}
bestAnswer.live('click', function()
{
// some code....
});
actually i want to disable click property on bestanswer while IsBestanswer == “True”.
here i am using unbind() function. but it’s not working …
is there any methode for disable like adding some css property …actually i don’t know..
To unbind a
livehandler, calldie. (I didn’t make that up)However, if
bestAnsweris a single element, there’s no point in usingliveinstead ofbind.liveis designed to be used with a selector that will match elements in the future.Also, if you can write
bestAnswer.live, you don’t need to write$(bestAnswer), since it’s already a jQuery object.(As opposed to a DOM element, selector, or HTML string which you would need to call
$on)