title: PrototypeJS: how to select dynamically created elements?
body: <p>The website is using Prototype JS library.</p>
  
  <p>After page loads, it immediately executes Ajax request, which pulls out and displays more elements for the page.</p>
  
  <p>I need to be able to select those dynamically created elements and hide them with <code>.hide()</code> method.</p>
  
  <p>I have tried to select and hide them using <code>document.observe('dom:loaded', function() { $('my-new-dynamic-element').hide(); })</code>, but this code does not 'see' the dynamic elements.</p>
  
  <p>I saw Prototype has <a href="http://prototypejs.org/doc/latest/dom/Event/on/index.html" rel="nofollow"><code>.on()</code></a> method, but I am not sure which Event should I specify in my case? I tried Event 'load', but no success.</p>
  
  <p>I would appreciate any tips how I could solve this problem.</p>
  
  <p><em>UPDATE:</em> I need to accomplish this in the Magento CMS backend, so I cannot, or better - I do not want to modify original Magento javascript codes and ajax request HTML output. So I need to accomplish this by adding extra custom Javascript code which is using PrototypeJS selectors on dynamically published elements. They need to be hidden, and never shown again. I hope there is a simple couple of lines solution for this.</p>
  
  <p><em>PS: I am trying to hide some address elements in Magento Admin -> "Create New Order" page, where all the customer contact data is pulled with ajax request after the main page is loaded. But I don't think this information is important for the problem description.</em></p>