Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda