How can a DIV act like another element in Javascript?
<p>My skills in Javascript are limited and for practicing i'm trying to programatically fill some elements using JS code, using Chrome's Developer Tools. I navigate to a site, access the console and try to manipulate DOM elements using JS code.</p>

<p>Usually elements a user can input data are INPUT, TEXTAREA , SELECT and so on. But latelly i've been seeing elements that are user-editable, but are simply DIVs. In other words, a DIV acting like an INPUT or TEXTAREA, and this got me confused.</p>

<p>Here is an example : i extracted this source from a page to post topics in a Facebook Group. </p>

<p>Note that the div that has the 'Write something' innerhtml works as a textarea in the page. You can reproduce this code in any Facebook Group, ie <a href="https://www.facebook.com/groups/914737511952904/" rel="nofollow">https://www.facebook.com/groups/914737511952904/</a> (you might need to join the group before see the box to post a topic).</p>

<pre><code>&lt;div class="_1mwp _1mwq _5bu_ _5yk1"&gt;&lt;div class="_5yk2" tabindex="-2"&gt;
 &lt;div class="_5rp7"&gt;
   &lt;div class="_1p1t"&gt;
    &lt;div class="_1p1v" id="placeholder-   2bc29"&gt;Write something... &lt;/div&gt;
   &lt;/div&gt;
 &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>If this element was a TEXTAREA, i could easily do something like </p>

<pre><code> document.getElementById('elementId').value = 'New text';
</code></pre>

<p>But the 'textarea' element in the above case is actually a DIV and nothing else. </p>

<p>How can i insert text on it using JS ? An how can a DIV act like a textarea or an input ?</p>

<p>Thanks !</p>