页面A中有2个frame:top、bottomtop为:
<div id="main">vv</div>
<div id="main1">cc</div>
<div id="main2">dd</div>
....bottom为:
<div id="main2"><input type="text" /></div>
<div id="main1"><input type="text" /></div>
<div id="wap"><input type="text" /></div>
....
<input type="submit" name="Submit" value="check" onclick="check();" /></div>我想点击check按钮时遍历bottom中所有的input的值与top中相应ID的div的innerText,匹配2个是否一致
该怎样写check()呢?急~~~~~~~~

解决方案 »

  1.   

    类似下面,
    细节自己修改下check()
    {
        
        for(var i = 0 ; i < document.getElementsByTagName("text").length ; i++)
        {
            for(var j = 0 ; j < 3 ; j++)
            {
                if(document.getElementsByTagName("text")[i].text == document.getElementById("main" + j.tostring().innerHTML)
                {
                 ......
                }
            }
        }
    }
      

  2.   

    if(document.getElementsByTagName("text")[i].text == document.getElementById("main" + j.tostring()).innerHTML)