如何在多嵌套框架内访问和设置元素的值

时间:2015-06-01 07:54:07

标签: html vbscript

<html><head>
<title>content</title>
</head>
<frameset rows="68,*,20" border="0" frameborder="no" framespacing="0">
    <frameset cols="0,0,*" frameborder="0" border="0">...</frameset>
    <frameset cols="170,*" frameborder="0" border="0">
        <frame src="/html/main/menu.asp" name="menufrm" id="listfrm" frameborder="no" border="0" scrolling="auto" 
            target="_self" marginwidth="0" marginheight="0" noresize="">...</frame>
        <frameset rows="70,*" border="0" frameborder="0" framespacing="0">
            <frame src="/html/main/tab.asp" name="tabfrm" id="tabfrm" frameborder="no" border="0" scrolling="no" target="_self" 
                marginwidth="0" marginheight="0" noresize="">...</frame>
            <frame src="" name="contentfrm" id="contentfrm" frameborder="0" border="0" scrolling="auto" target="_self"
                marginwidth="0" marginheight="16" noresize="">
                #document
                <html>
                <head>...</head>
                <body onload="LoadFrame();" marginwidth="0" marginheight="16">
                    <form id="ConfigForm" action="">
                        <script>...</script>
                        <table width="90%" border="0" cellpadding="0" cellspacing="0">
                            <tbody>
                                <tr>...</tr>
                                <tr>
                                    <td id="Security">
                                        <table class="tabInfo">
                                            <tbody>
                                                <tr width="100%" class="trTabConfigure" align="center">...</tr>
                                                <tr class="trTabConfigure" align="right">...</tr>                           
                                                <tr class="trTabConfigure" align="right" readonly="true" id="Select_Anon">
                                                    <td width="40%" align="right">...td>
                                                    <td width="60%" align="left">
                                                        <input maxlength="252" type="text" align="left" name="Anony_Item" id="Anony_Item" 
                                                        style="width:150px">
                                                    </td>

                                        </tr>

我想使用vbscript访问并设置元素id="Anony_Item"的值。

我尝试了以下代码但是给了我一个错误:

Set setNAI = IE.document.getElementByID("contentfrm").contentWindow.document.All("Anony_Item")
setNAI.value = "NAI_Value"

但是上面给我一个错误? 请帮忙。

0 个答案:

没有答案