title: document.getElementById for different "id" values or alternative to this code
body: <p>Actually I'm trying to create an "autosave" system for the content of some "" marked as contenteditable.</p>
  
  <p>DIVS have an structure like his.</p>
  
  <pre><code>&lt;div id=test_one contenteditable=true&gt;
  &lt;div id=test_other contenteditable=True&gt;
  [..]
  </code></pre>
  
  <p>And there's a function like this, that works fine for only one div (when the user stops writing on a div save the data)</p>
  
  <pre><code>var timeoutId;
  document.getElementById('test_one').addEventListener("input", function() {
      clearTimeout(timeoutId);
      timeoutId = setTimeout(function() {    
            function_to_save();    
      }, 1000);
  }, false);
  </code></pre>
  
  <p>The problem is that I try to use this same function for all the divs with a id name that includes the word "test", because all this names are generated dynamically... </p>
  
  <p>I try to use regular expressions what I can't make that work... any idea or alternative code?</p>