Is there a way to do the following in JavaScript?
- get a div by a class name,
- get the iframe inside the div
- and add an attribute (frameborder = 0)
<html>
<body>
<div class="calendar">
<iframe></iframe>
</div>
</body>
</html>
To get a div by class name:
Assuming there’s only one
Get the iFrame inside:
set an attribute:
Or, since
getElementsByClassNameisn’t supported in old versions of IE, consider setting the id on theiFrameand simply doing: