How can i bind and unbind a .delegate in jquery.
Say i use this js for simple clicking.
function spanclick(){
$(this).html('<input class="mm" value="' + $(this).text() + '"/>');
$(this).unbind("click");
}
$("span.la").click(spanclick);
$("span.la").unbind("click");
But now i want to switch to delegate in place of simple click.
Because as of course i want to use it to selectors that have not been created on the time of page load. or do i need to use .live()
Question:
How do i bind and unbind delegate's in jquery ?
To use delegate, use
span.laparent element (preferred) ordocumentorbody:To undelegate: