Loaded Click Event

Loaded Click Event

I am using ajax to load html code snippet containing links (id = "edit") into a main class = "container". The problem is that I can't fire the loaded link event, here's the example:

code : html + html loaded :
  1. <main class="container">
  2.    <div class="profile row">
  3.      ...
  4.         <table>
  5.          ...
  6.            <a id="edit">...</a>
code : jquery :
  1. $ (document) .ready (function () {
         $ ("# edit"). click (function () {
             alerta ("Johnny");
         });
    });