Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

215
Views
How to access and edit the attributes of the controls inside an iframe through javascript?

I need to access a button inside an iframe through javascript. Below is the iframe code in the aspx file:

<iframe id="headerframe" runat="server" src="./DashHeader.html" marginheight="0" marginwidth="0" frameborder="0" style="width:inherit;height:inherit;overflow:hidden;">
            </iframe>

There is a tab strip in the same file:

<telerik:RadTabStrip RenderMode="Lightweight" runat="server" ID="RadTabStrip1" Orientation="HorizontalTop" Width="100%" Height="32px" OnClientTabSelected="tabClicked" OnClientTabSelecting="savePreviousTab" SelectedIndex="0" >
                </telerik:RadTabStrip>

When I try to access the control btnSearch(which belongs to the iframe) from the tabClick method of the tabstrip, I am able to find the button and perform the required action.

function tabClicked(sender, args) {
                    document.getElementById('headerframe').contentWindow.document.getElementById('btnSearch').style = "something";                                                     
                }

But when I try to access the same control from a different custom javascript function, I am not able to access the required control.

function setSearchButtonVisibility()
                {
                    document.getElementById('headerframe').contentWindow.document.getElementById('btnSearch').style = "something";
                }

Please suggest what needs to be done in this case.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!