title: pass click event between two page by localStorage
body: <p>I want to take a click event from <strong>2nd page</strong> . <strong>1st page</strong> have a link for <strong>2nd page</strong>, there have a <strong>button</strong> when click the button it add a <em>HTML row</em> on <strong>1st page</strong>. I am trying to use <code>localStorage</code> for passing data. My code don't work, take a look below:<br /></p>
  
  <blockquote>
    <p>1st Page.html</p>
  </blockquote>
  
  <p><br />
  <strong>HTML</strong></p>
  
  <pre><code>&lt;div id="content"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>var     output = document.getElementById('content');
  
  addEvent(window, 'storage', function (event) {
    if (event.key == 'StorageName') {
      output.innerHTML = event.newValue;
    }
  });
  </code></pre>
  
  <blockquote>
    <p>2nd Page.html</p>
  </blockquote>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;input id="data" type="button" value="+" onclick="addRow()"&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>addEvent(dataInput, 'keyup', function () {
  localStorage.setItem('StorageName', this.value);
  });
  
  var dataInput = dataInput = document.getElementById('data');
  object.onclick = function(){
  addRow() {
  var div = document.createElement('div');
  
  div.className = 'row';
  
  div.innerHTML = '&lt;button&gt;GO&lt;/button&gt;';
  
  document.getElementById('content').appendChild(div);
  }
  };
  </code></pre>