I have been trying to embed Iframe in my react js project. The issue i am facing is that the source of Iframe is an external url which returns HTML form to me and then when i submit that form, they hit their own api to validate data and return HTML for success or failure.
So i need to access some specific classnames in order to know whether my response is successfull or not like
alert-success for success response
alert-failure for failed response
This is my code below for that
<iframe
id="one"
src={`https://xxxxxxxxx.com/Payments/xxxxxx?id=12232331&pais=pt&aseguradora=dg&nombre=CustomerName&apellidos=CustomerSurname&codPostal=CustomerPostalCode`}
width="100%"
height="300"
></iframe>
Now how can i access the classname in order to find response for that form, or is there any other workaround for this ?
tried var iframe = document.getElementsByTagName("iframe")[0];
but then I cannot access any classnames here or even after submitting the form (for alert-success or alert failure)