function createChatbox (from) {
console.log(from); //from= Hola
var chatBoxId= from+ 'chatbox';
$('#privateChat').append('<div id="'+ chatBoxId +'" class="chatbox"></div>');
$('#' + chatBoxId).draggable({ handle: '.drag' });
$('#' + chatBoxId).append('<p id="titulo" class="drag">Chat privado con: '+ from +'</p> <div id="'+ from +'textchat" class="textchat"></div><form id="msgPrivate" onsubmit="return formSubmit('+ from +')"><input type="text" id="privateMsg" class="texto" required><input type="submit" class="boton" value="Enviar" class="btnLogIn" id="sendPrivate"> ');
}
function formSubmit (from) {
console.log("entro en formSubmit");
console.log("from es: " +from); //from= [object HTMLDivElement]
sendPrivateMessage(from);
return false;
}
当它转到 formSubmit('+ from +') 时,from 转换为 [object HTMLDivElement] 我如何从该对象获取数据?