I have this portion of code in my javascript
file
function insertRespuesta(id, attach)
{
document.getElementById(attach).value += " #" + id + " ";
document.getElementById(attach).focus();
}
My html
file:
<textarea name="textoConversacion" id="textoConversacion" class="mensaje-mensajeria"></textarea>
<a href='#' class='decoracion-link' onClick="insertRespuesta('<?php echo $cada['contador']; ?>','textoConversacion');">#<?php echo $cada['contador']; ?></a>
So if I click the link
it will be focused on the textarea but the textarea cursor will be in the last position I had, and I need to put in the last cursor character + 1.
I preffer not using jquery
.