javascript getattribute issues IE 11

javascript getattribute issues IE 11

本文关键字:IE issues getattribute javascript      更新时间:2023-09-26

我在javascript中使用getattribute,它在IE 11中不起作用。getattribute有等效项吗。下面是我的代码。

代码:-

var innerFrames = currentRow.all.tags("iframe");
if(innerFrames.length > 0)
{
  var currentFrame = innerFrames[0];
  var frmID = currentFrame.getAttribute("id");
  var ownerID = currentFrame.getAttribute("displayID");
}
var sGroupCaption = (currentFrame.getAttribute("Caption") == null) ? "" : currentFrame.getAttribute("Caption");
if (currentFrame.getAttribute("isEmpty")!= null){ }
    var Type = (currentFrame.getAttribute("displayType") == null) ? "" : currentFrame.getAttribute("displayType");

请建议我可以在javscript 中复制这个getattribute

感谢

您可以直接访问属性,如下所示:

  • currentFrame.myProperty
  • currentFrame["myProperty"]