Set scroll to an iframe dynamically in IE

Posted by Aneesh on Stack Overflow See other posts from Stack Overflow or by Aneesh
Published on 2010-04-07T03:57:38Z Indexed on 2010/04/07 4:03 UTC
Read the original article Hit count: 223

Filed under:
|

I have an iframe. I am setting the content of the iframe (different domain - like www.google.com) through a form submission.Currently it's scrolling attribute is set to 'no'.

<iframe name="testFrame" id="testFrame" frameborder="1" scrolling="no" width="500" height="200"></iframe>
<form name="testForm" id="testForm" action="http://www.google.com" target="testFrame"></form>
<button name="testBtn" value="submit" onclick="submitForm();">submit</button>

I want to put scroll to this iframe dynamically.

$("#testFrame").attr('scrolling','yes');

This is working in Firefox but not in IE. Also tried with:

document.getElementById("testFrame").style.overflow="scroll";

No luck...:( Help me please...

© Stack Overflow or respective owner

Related posts about iframe

Related posts about JavaScript