access iframe name from inside iframe

后端 未结 5 1077
感动是毒
感动是毒 2020-12-14 00:28

I though this would be simple enough but I can\'t find the answer. I need to know how I can access an iframe\'s name from within said iframe. I was trying something like thi

5条回答
  •  暖寄归人
    2020-12-14 01:09

    Something like this should work:

    parent.document.getElementById('idhere').name;
    

    You have to use the parent and then get the element either byId, Name, etc... then access the name property.

    So your code should be like:

    
    

提交回复
热议问题