div里的内容怎么用js调用啊,急!!!

JavaScript022

div里的内容怎么用js调用啊,急!!!,第1张

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>

<HEAD>

<TITLE>New Document </TITLE>

</HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!--

window.onload = function goSelect(id) {

for(var i=1i<=3i++){

eval('var testdiv = document.getElementById("left'+i+'")testdiv.innerHTML="使用单位:"var testdiv = document.getElementById("right'+i+'")testdiv.innerHTML="使用期限:"')

}

}

//-->

</SCRIPT>

<BODY>

<div id="box">

<div id="text_main1">

<div id="left1"></div>

<div id="right1"></div>

</div>

<div id="text_main2">

<div id="left2"></div>

<div id="right2"></div>

</div>

<div id="text_main3">

<div id="left3"></div>

<div id="right3"></div>

</div>

</div>

</BODY>

</HTML>

<div class="ad" style="height:60pxwidth:574px" >

<div class="ad" style="width:574pxheight:59pxborder:1px dotted #599EDFcolor:#48BFDD">

<div style="width:50%height:60pxfloat:left">

<script language="javascript" src="/js/daifu.js"></script>

</div>

<div style="width:50%height:60pxfloat:left">

<script language="javascript" src="/js/wei.js"></script>

</div>

</div>

</div>

以下是js代码(确保你的js文件调用的地址是否正确)

daifu.js的代码:

document.write('<a href="urladdress" target="_blank"><img src="imgurl1" alt="imgname1" title="imgtitle1"/></a>')

wei.js的代码:

document.write('<a href="urladdress" target="_blank"><img src="imgurl2" alt="imgname2" title="imgtitle2"/></a>')

只是js没写在页面上罢了 这个用的jquery的menu插件

<script language="JavaScript" type="text/javascript" src="js/jquery.min.js"></script>

<script language="JavaScript" type="text/javascript" src="js/jquery.menu.js"></script>

<script language="JavaScript" type="text/javascript" src="js/jquery.hoverIntent.minified.js"></script>

去这几个js文件里面找