title: Javascript get data from [object HTMLDivElement]
body: <pre><code>function createChatbox (from) {
  console.log(from); //from= Hola
  var chatBoxId= from+ 'chatbox';
  $('#privateChat').append('&lt;div id="'+ chatBoxId +'" class="chatbox"&gt;&lt;/div&gt;');
  $('#' + chatBoxId).draggable({ handle: '.drag' });
  $('#' + chatBoxId).append('&lt;p id="titulo" class="drag"&gt;Chat privado con: '+ from +'&lt;/p&gt; &lt;div id="'+ from +'textchat" class="textchat"&gt;&lt;/div&gt;&lt;form id="msgPrivate" onsubmit="return formSubmit('+ from +')"&gt;&lt;input type="text" id="privateMsg" class="texto" required&gt;&lt;input type="submit" class="boton" value="Enviar" class="btnLogIn" id="sendPrivate"&gt; ');
  }
  
  function formSubmit (from) {
  console.log("entro en formSubmit");
  console.log("from es: " +from); //from= [object HTMLDivElement]
  sendPrivateMessage(from);
  return false;
  }
  </code></pre>
  
  <p>and when it goes to formSubmit('+ from +') the from transforms into [object HTMLDivElement]
  how can i get the data from this object?</p>