Reputation: 121
How can I get the iframe src param from inside the iframe itself if I don't have its id attribute but I have name attribute of it?
For example:
<iframe name="ambiguous" src="some src here"></iframe>
Upvotes: 0
Views: 588
Reputation: 12854
You can get access like :
document.getElementsByName("ambiguus").item(0).getAttribute("src");
Note :
This solution works if the name is unique on your HTML page
Reference
Upvotes: 1