submit a comment on Instagram posts using jQuery or pure javascript

谁都会走 提交于 2019-12-06 14:52:00

I found a solution but that is not as @SalmanShariati wrote in his comment.

Instead of triggering a KeyBoardEvent on the textarea trigger a submit event on the parent form.

var form = document.querySelector("form"); // that is the only form on the page
form.dispatchEvent(new Event("submit")); // make sure to change the value of the textarea to your required comment before doing this

This worked for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!