0

My DOM has iframe with id="" and name ="".

The iframe has a form inside, inside the form is a table and I need to fire a click event on the table data. The table data(td) has a link. When the link is clicked a function needs to fire off.

How do I get this working using jQuery?

thecodeparadox
  • 86,271
  • 21
  • 138
  • 164
Do Good
  • 1,285
  • 4
  • 13
  • 17
  • Maybe this one will help you http://stackoverflow.com/questions/1609741/how-to-add-click-event-to-a-iframe-with-jquery – starcorn May 07 '12 at 19:30
  • 1
    Can you post the html you're using? Also blank id and name attributes don't seem correct -- or at least not good practice. – Kevin Bedell May 07 '12 at 20:18

1 Answers1

1

Possibly something like this:

$("#iframeID").contents().find("td.data").children("a").on("click", function() {
    // do something
    return false;
});
VisioN
  • 143,310
  • 32
  • 282
  • 281
  • The id="" is that case how to use #iframeID also what is td.data. can you explain because the above did not seem to work. – Do Good May 07 '12 at 19:44