views:

16

answers:

2

hi i am using Jquery 1.3

i have a html block in which there are many tags like input , button , hyperlink etc.

now whenever i clone this block of html its events don't get copied automatically as clone() only copies html block , so i wan to know that how to assign events to cloned html block ?

+1  A: 

http://api.jquery.com/clone/ from this documentation, just use (true) when you call the clone method.

Gabriel
well true is to copy only child elements , not their values
Hunt
"withDataAndEvents A Boolean indicating whether event handlers should be copied along with the elements." This is per 1.0, in 1.4 it copies data as well.
Gabriel
+1  A: 

Try jquery live() method. It was mentioned in answer to similar question on SO, but I can't find it at the moment.

cji
live () method is not available in jquery 1.3
Hunt
In the docs I saw: ".live( eventType, handler ) version added: 1.3" - but I didn't test it, so it can be not available after all.
cji
`live()` most certainly is available in jQuery 1.3. Documentation: http://api.jquery.com/live/ It works just fine in 1.3.2 with minor limitations.
Brock Adams
m sorry live handler is there , but i am using blur event and in jquery 1.3 live('blur',function(){}) is not supported
Hunt