Question

Guys is it possible to assign Double click event to A HREF which is dynamically generated , to which i need to assign a user function with parameter that will differ for each a HREF.kindly let me know.

Was it helpful?

Solution

you can use class instead of id and do what Matt said.

$('.Class').live('click',function(event)
{
  myFunc($(this));
});

OTHER TIPS

$('.generated').live('click',function(event)
{
  //determine params here

  myFunc(params);
});

For every 'a' tag that ends up on your page, when it is clicked, it will call myFunc with the jQuery version of itself as the paramater

Try this function. This is a simple JavaScript. Using this method we can assign a function dynamically on an html element.

var funcRef = new Function("testFunction()"); document.getElementById("elementid").onclick=funcRef;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top