Hi Ellen,
As we can see in your first screenshot you paste code in console but do not select a needed iframe here:
As soon as you select an iframe you can paste code in console and test.
Could you please clarify whether you take the first screenshot after you added code to Page Show event, or do you paste it straight away?