I am a beginner with react.js and it\'s amazing but I am facing a real problem: I need to set the value of an input using plain and pure javascript but form some reason reac
I have written and use this function to trigger the change state for the field:
function doEvent( obj, event ) {
/* Created by David@Refoua.me */
var event = new Event( event, {target: obj, bubbles: true} );
return obj ? obj.dispatchEvent(event) : false;
}
Use it like this:
var el = document.getElementById("CntctFrm2emailField");
el.value = "testing@gmail.com";
doEvent( el, 'input' );