when change one of textareas value change others values
<p>I'm trying to change multi textareas values when user changes one of them with Javascript (I don't know how to do it with jQuery also), It changes all values to undefined instead of the value I wanted
<br>
<a href="https://jsfiddle.net/xnsucxou/3/" rel="nofollow noreferrer">JSFIDDLE</a></p>

<h2><br>HTML</h2>

<pre><code>  &lt;div id="frntnd-edtr" class="col-xs-12"&gt;
          &lt;!-- Nav tabs --&gt;
          &lt;ul class="nav nav-tabs" role="tablist"&gt;
              &lt;li role="presentation" class="active"&gt;&lt;a href="#status" aria-controls="status-tab" role="tab" data-toggle="tab" aria-expanded="true"&gt;&lt;i class="material-icons"&gt;sms&lt;/i&gt;&lt;p&gt;حالة&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;li role="presentation" class=""&gt;&lt;a href="#post" aria-controls="post" role="tab" data-toggle="tab" aria-expanded="false"&gt;&lt;i class="material-icons"&gt;description&lt;/i&gt;&lt;p&gt;مقالة&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;li role="presentation" class=""&gt;&lt;a href="#quote" aria-controls="quote" role="tab" data-toggle="tab" aria-expanded="false"&gt;&lt;i class="material-icons"&gt;format_quote&lt;/i&gt;&lt;p&gt;اقتباس&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;li role="presentation" class=""&gt;&lt;a href="#story" aria-controls="story" role="tab" data-toggle="tab" aria-expanded="false"&gt;&lt;i class="material-icons"&gt;import_contacts&lt;/i&gt;&lt;p&gt;قصة قصيرة&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;
              &lt;li role="presentation" class=""&gt;&lt;a href="#chapter" aria-controls="chapter" role="tab" data-toggle="tab" aria-expanded="false"&gt;&lt;i class="material-icons"&gt;receipt&lt;/i&gt;&lt;p&gt;فصل من رواية&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;
          &lt;/ul&gt;
          &lt;!-- Tab panes --&gt;
          &lt;div class="tab-content"&gt;
              &lt;div role="tabpanel" class="tab-pane active" id="status"&gt;
                  &lt;form class="col-xs-12" method="post" action="" wtx-context="839CDBD9-2EB6-4C4D-91C1-AE6F0F27F4A0"&gt;
                      &lt;input type="hidden" name="post-type" value="status" wtx-context="D32E77E0-5799-4D33-B130-85A998170970"&gt;
                      &lt;textarea name="status-content" class="mg-input col-xs-10 col-sm-11" placeholder="ماذا؟"&gt;&lt;/textarea&gt;
                      &lt;fieldset class="actions"&gt;
                          &lt;button id="send-status" type="submit" class="col-xs-2 col-sm-1"&gt;&lt;i class="material-icons"&gt;send&lt;/i&gt;&lt;/button&gt;
                      &lt;/fieldset&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
              &lt;div role="tabpanel" class="tab-pane" id="post"&gt;
                  &lt;form class="col-xs-12" method="post" wtx-context="5083B580-008B-49B2-8185-D02C7F8010E7"&gt;
                      &lt;input type="hidden" name="post-type" value="post" wtx-context="9673EA74-2C4F-4741-A436-8539A9C0636E"&gt;
                      &lt;input name="title" class="mg-input col-xs-10 col-sm-11" placeholder="عنوان المقالة" wtx-context="F56E788D-846C-4148-AD9A-3EAA5FC2B6B0"&gt;
                      &lt;textarea placeholder="ماذا؟" class="mg-input col-xs-10 col-sm-11" name="post-content"&gt;&lt;/textarea&gt;
                      &lt;fieldset class="actions"&gt;
                          &lt;button id="send-post" class="col-xs-2 col-sm-1" type="submit"&gt;&lt;i class="material-icons"&gt;send&lt;/i&gt;&lt;/button&gt;
                          &lt;button id="drafts-post" class="col-xs-2 col-sm-1 draft"&gt;&lt;i class="material-icons"&gt;drafts&lt;/i&gt;&lt;/button&gt;
                          &lt;button id="fullscreen-post" class="col-xs-2 col-sm-1 fullscreen"&gt;&lt;i class="material-icons"&gt;fullscreen&lt;/i&gt;&lt;/button&gt;
                      &lt;/fieldset&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
              &lt;div role="tabpanel" class="tab-pane" id="quote"&gt;
                  &lt;form class="col-xs-12" method="post" action="" wtx-context="10BDB7C7-8DA0-43AA-84F5-5A9C8D45F3C0"&gt;
                      &lt;input type="hidden" name="post-type" value="quote" wtx-context="00814A57-8974-4C27-A373-C8F1A8573E01"&gt;
                      &lt;textarea name="quote-content" class="mg-input col-xs-10 col-sm-11" placeholder="ماذا؟"&gt;&lt;/textarea&gt;
                      &lt;input name="author" class="mg-input col-xs-10 col-sm-11" placeholder="من القائل؟" wtx-context="99078C64-D6B3-49BA-8980-D58A31F8A628"&gt;
                      &lt;fieldset class="actions"&gt;
                          &lt;button id="send-status" type="submit" class="col-xs-2 col-sm-1"&gt;&lt;i class="material-icons"&gt;send&lt;/i&gt;&lt;/button&gt;
                      &lt;/fieldset&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
              &lt;div role="tabpanel" class="tab-pane" id="story"&gt;
                  &lt;form class="col-xs-12" method="post" wtx-context="3E3A3A33-4C7B-4765-B8AC-06F15B4553E4"&gt;
                      &lt;input type="hidden" name="post-type" value="story" wtx-context="20F97C01-EFA4-4DF8-9F78-B89685553C26"&gt;
                      &lt;input name="title" class="mg-input col-xs-10 col-sm-11" placeholder="اسم القصة" wtx-context="044CD2A5-6596-44D7-865C-F7DC1F27B2F1"&gt;
                      &lt;textarea placeholder="ما الذي حصل؟" class="mg-input col-xs-10 col-sm-11" name="story-content"&gt;&lt;/textarea&gt;
                      &lt;fieldset class="actions"&gt;
                          &lt;button id="send-story" class="col-xs-2 col-sm-1" type="submit"&gt;&lt;i class="material-icons"&gt;send&lt;/i&gt;&lt;/button&gt;
                          &lt;button id="drafts-story" class="col-xs-2 col-sm-1 draft"&gt;&lt;i class="material-icons"&gt;drafts&lt;/i&gt;&lt;/button&gt;
                          &lt;button id="fullscreen-story" class="col-xs-2 col-sm-1 fullscreen"&gt;&lt;i class="material-icons"&gt;fullscreen&lt;/i&gt;&lt;/button&gt;
                      &lt;/fieldset&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
              &lt;div role="tabpanel" class="tab-pane" id="chapter"&gt;
                  &lt;form class="col-xs-12" method="post" wtx-context="DE08CAC4-64FA-4366-876B-51171A833CD6"&gt;
                      &lt;input type="hidden" name="post-type" value="chapter" wtx-context="0367AE1C-C218-4665-8685-43AEEF1826CB"&gt;
                      &lt;input name="chapter-num" type="number" min="0" step="0.5" class="mg-input col-xs-2 col-sm-2" placeholder="رقم الفصل" wtx-context="DBE69C57-E173-4FC0-82B6-BC6816B04549"&gt;
                      &lt;select name="cat" id="cat" class="postform select2-hidden-accessible" tabindex="-1" aria-hidden="true" wtx-context="E741052F-EAEC-4D08-A160-B81C0B8644FB"&gt;
    &lt;option value="-1" selected="selected"&gt;الرواية&lt;/option&gt;
  &lt;/select&gt;&lt;span class="select2 select2-container select2-container--default" dir="ltr" style="width: auto;"&gt;&lt;span class="selection"&gt;&lt;span class="select2-selection select2-selection--single" role="combobox" aria-haspopup="true" aria-expanded="false" tabindex="0" aria-labelledby="select2-cat-container"&gt;&lt;span class="select2-selection__rendered" id="select2-cat-container" title="الرواية"&gt;الرواية&lt;/span&gt;&lt;span class="select2-selection__arrow" role="presentation"&gt;&lt;b role="presentation"&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="dropdown-wrapper" aria-hidden="true"&gt;&lt;/span&gt;&lt;/span&gt;
                          &lt;input name="title" class="mg-input col-xs-10 col-sm-11" placeholder="عنوان الفصل" wtx-context="D7D2E640-302B-46DD-8D63-1B2009BA0198"&gt;
                          &lt;textarea placeholder="ما الذي حصل؟" class="mg-input col-xs-10 col-sm-11" name="chapter-content"&gt;&lt;/textarea&gt;
                          &lt;fieldset class="actions"&gt;
                              &lt;button id="send-chapter" class="col-xs-2 col-sm-1" type="submit"&gt;&lt;i class="material-icons"&gt;send&lt;/i&gt;&lt;/button&gt;
                              &lt;button id="drafts-chapter" class="col-xs-2 col-sm-1 draft"&gt;&lt;i class="material-icons"&gt;drafts&lt;/i&gt;&lt;/button&gt;
                              &lt;button id="fullscreen-chapter" class="col-xs-2 col-sm-1 fullscreen"&gt;&lt;i class="material-icons"&gt;fullscreen&lt;/i&gt;&lt;/button&gt;
                          &lt;/fieldset&gt;
                  &lt;/form&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
</code></pre>

<h2>JS</h2>

<pre><code>var textareas = document.getElementById("frntnd-edtr").getElementsByTagName("textarea"),x;
console.log(textareas);
for (x in textareas) {
  textareas[x].oninput = function(){
  console.log(textareas[x].value);
    for (z in textareas) {
      if(z !== x) {
      textareas[z].value = textareas[x].value;
      console.dir(textareas[x].value);
      }
    }
  };
}
</code></pre>