您现在的位置是:首页 > 电脑技术查询 > web开发

提取iframe,如何提取

编辑:chaxungu时间:2022-10-02 23:18:23分类:web开发

提取iframe,怎么提取?
<IFRAME id= cls=2 ins=cls attr=3 1> </IFRAME> asdfasd <IFRAME id= cls=2 ins=cls attr=3 2> </IFRAME> aasf///adfadf/ <IFRAME id= cls=2 ins=cls attr=3 3> </IFRAME>

想提取iframe数组,match能返回数组吗?
<IFRAME id= cls=2 ins=cls attr=3 1> </IFRAME>
<IFRAME id= cls=2 ins=cls attr=3 2> </IFRAME>
<IFRAME id= cls=2 ins=cls attr=3 3> </IFRAME>

------解决方案--------------------
<script>
var iframes = document.getElementsByTagName( "iframe ");
for(i = 0;i < iframes.length;i ++){
alert(iframes[i].id);
}
</scritp>