title: Loading data with Ajax don't let me add JavaScript Events
body: <p>today while working with $.ajax method from the JQuery library and loading data from a page based on PHP i have found a problem while trying to attach some events.</p>
  
  <p>I have a html document like that:</p>
  
  <pre><code>&lt;html&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;script src="/public_html/assets/js/jquery/jquery-3.2.1.min.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <pre><code>.container {
  
    display: block;
    width: 500px;
    height: 500px;
    background: red;
  
  }
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <pre><code>&lt;!-- Here goes the container --&gt;
  
   &lt;div class='wrapper'&gt;&lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;script&gt;
  
    $(document).ready(function() {
  
    $(".container").on("contextmenu", function (event) {
  
      event.preventDefault();
  
      alert("It works.");
  
    });
  
    $.post("example.php", function(result) {
  
      $(".wrapper").html(result);
  
    });
  
  
    }); 
  
  &lt;/script&gt;
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <p>Where at the end of the page there is the Ajax request to that PHP file:</p>
  
  <pre><code>echo "&lt;div class='container'&gt;";echo "&lt;/div&gt;";
  </code></pre>
  
  <p>When the request end, the container appears but when trying to contectmenu it, it doesn't works. However, if it's done through raw html, it works. Any way of solving this?</p>