diff --git a/boards/static/js/thread.js b/boards/static/js/thread.js --- a/boards/static/js/thread.js +++ b/boards/static/js/thread.js @@ -81,12 +81,14 @@ function moveCaretToEnd(el) { function addQuickReply(postId) { var textToAdd = '>>' + postId + '\n\n'; - $('#id_text').val($('#id_text').val()+ textToAdd); + var textAreaId = '#id_text'; + $(textAreaId).val($(textAreaId).val()+ textToAdd); var textarea = document.getElementById('id_text'); + $(textAreaId).focus(); moveCaretToEnd(textarea); - $("html, body").animate({ scrollTop: $('#id_text').offset().top }, "slow"); + $("html, body").animate({ scrollTop: $(textAreaId).offset().top }, "slow"); } $(document).ready(function(){