It works fine when I'm using document.querySelector("input[value='female']").click()
in test2.php and selects the radio button with the value of female, but it doesn't work in test1.php, when test2.php is inside of an iframe. Is there any work around I can use to fix this?
test1.php
<iframe src="http://chatwithibot.com/test2.php"></iframe>
test2.php
<form action="/testx.php" method = "POST">
<input type="radio" name="gender" value="male"> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="other"> Other
<input type="submit" value="Submit">
</form>
Edit: the duplicate solution link seems to only answer question about how to select things from inside an iframe, but not how to change them.