I'm a beginner to HTML DOM and what I want to achieve is focus textarea
so that cursor will be placed in it to type.
<div class="_4bl9">
<div class=" _30z _4h96">
<textarea name="xhpc_message_text" placeholder="Write something..." class="_4h98"></textarea>
<input value="" name="xhpc_message" type="hidden">
</div>
</div>
I was using this code before and it was working but not anymore.
document.getElementsByName('xhpc_message')[0].focus()
Can any one suggest me other way to do? Thanks.
There is a typo in your script. It's not
xhpc_message
it isxhpc_message_text