There are several posts on this, but no solution worked for me.
I have parent.com
and iframe in that loading child.com
I want to access value of an input field which is inside in child.com (inside iframe)
here is what I tried so far
document.getElementById("iframeID").contentWindow.document.getElementById("input").value;
jQuery("#iframeID").contents().find('#input').val();
window.frames[0].getElementById("input").value;
jQuery('iframe[name=iframe]').contents().find('#input').val();
every attempt is resulting the same response
Blocked a frame with origin "parent.com" from accessing a frame with origin "child.com". Protocols, domains, and ports must match.
I dont how this worked for others and many accepted these answers.