I have a textarea in admin post page when creating new post, that's title:
<textarea id="post-title-0" class="editor-post-title__input" placeholder="Add title" rows="1" style="overflow: hidden; overflow-wrap: break-word; resize: none; height: 94px;">vbhgfhfgh</textarea>
I want to update title on the fly using jQuery. I tried
$('#post-title-0').val('some value'); $('#post-title-0').text('some value');
val() updates title but when I click on title it is being erased. Is there anyway to update title via JS?