怎么在下面的HTML里调用数组cs[]的值 时间:2020-05-11 人气:0 <script LANGUAGE="JavaScript" defer> var cs=new Array(5); var mydata="red,300,200,我爱北京天安门,http://blog.yb023.com/uploadfile/200611180016400.wma"; var cs=mydata.match(/[^,]+/g); var obj = document.getElementById("dodododo"); obj.innerHTML = cs[3] + " " + cs[4]; obj.style.width = cs[2]; obj.style.height = cs[1]; obj.style.backgroundColor = cs[0]; </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] <script LANGUAGE="JavaScript"> var cs=new Array(4); var mydata="320,45,1,http://blog.yb023.com/uploadfile/200611180016400.wma"; var cs=mydata.match(/[^,]+/g); </script> <script language="JavaScript"> var $ = function(id) { return document.getElementById(id); } $("a1").style.width = cs[0]; $("a1").style.height = cs[1]; $("a1").AutoStart = cs[2]; $("a1").url = cs[3]; </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] <script LANGUAGE="JavaScript" defer> var cs=new Array(5); var mydata="red,300,200,我爱北京天安门,http://blog.yb023.com/uploadfile/200611180016400.wma"; var cs=mydata.match(/[^,]+/g); var obj = document.getElementById("p"); obj.innerHTML = "宽300,高200的表格,字体为红色 "+cs.join("\n");+"</textarea> "; </script> [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行] 加载全部内容