michaelvino
michaelvino

Reputation: 66

Iframe border issue in IE8

I am trying to add iframe in my page. Its working fine in all the browser except IE8.

I have checkout stackoverflow.com. Many of the suggestion would be frameBorder="0". My scenario is i dont have a access to edit the line . so i tried using java script setAttribute but unfortunately its not working in IE8.

function removeBorder()
{
    document.getElementById("myframe").frameBorder="0";
}

Is there any possibility to create dynamic Attribute ?

Could you please help me ? Thanks in advance.

Upvotes: 0

Views: 99

Answers (1)

CME64
CME64

Reputation: 1672

this is the proper way to create an attribute in js

var att=document.createAttribute("frameBorder");
att.value = "0";
document.getElementById("myframe").setAttributeNode(att);

source : W3S

advice : read more about DOM elements and how to manipulate them

Upvotes: 1

Related Questions