I suck big time with Javascript and really would need your help right now. I am building a Wordpress plugin and trying to assign an enctype=“multipart/form-data” to write posts form without altering the original application core code.
I am trying this approach and have no results so far (also tried with document.getElementById(“post”))
var theForm = document.getElementsByName(“post”);
theForm.setAttribute(“enctype”, “multipart/form-data”);