外部js应该怎么写 html如何调用外部js文件,外部的js文件该怎么写,是什么格式的
- 综合知识
- 关注:3.12W次
<script src = "index_1.js" type="text/javascript"></script>; 你这个调用的就是外部js文件index_1.js。
onmouseover 和onmouseout直接写到html代码就可以。
<style>
.header_1{position:absolute;top:40px;left:220px;height:auto;width:auto;color:#FFFFFF;}
.d_over{background:#FF0000;}
.d_out{background:#FFFFFF;}
</style>
<div onm ouseover="this.className='d_over'" onm ouseout="this.className='d_out'">333333333333333</div>
2.怎么写一个外部js文件,网页里怎么用啊//JS文件内容:
var mySelect=new mSelect('mySelect','images/mSelect.css');
window.onload=function(){
var aS=document.getElementsByTagName('select');
for (var i=0;i<aS.length;i++){
switch(aS[i].getAttribute('mSty')){
case 'redLine':
mySelect.Create(aS[i],'redLine');
break;
case 'blueCircle':
mySelect.Create(aS[i],'blueCircle',true);
break;
case 'orangeHeart':
mySelect.Create(aS[i],'orangeHeart',true);
break;
}
}
}
//网页调用
<script type="text/javascript" src="scripts/mSelect.js"></script>
- 文章版权属于文章作者所有,转载请注明 https://dongkepu.com/zonghezhishi/qo97z4.html