I don’t think you can get the code from the iframe.
If it’s a code you are generating in your Airtable database, then you’d need to get it from your database directly (via API, presumably).
If you are talking about a code that Airtable generates, then presumably you’d have to grab it from the response hash (the json returned by the server when a user submits the form).