Chinaunix首页 | 论坛 | 博客
  • 博客访问: 701978
  • 博文数量: 158
  • 博客积分: 6010
  • 博客等级: 准将
  • 技术积分: 1643
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-11 14:37
个人简介

人法地,地法天,天法道,道法自然

文章分类

全部博文(158)

文章存档

2022年(1)

2020年(3)

2016年(1)

2014年(7)

2013年(4)

2010年(5)

2009年(86)

2008年(25)

2007年(26)

我的朋友

分类: Java

2007-11-19 20:24:31

在Ajax设计程序时动态加载文本域和下拉框:
其方法如下:
function createCellText(){
   var text=document.createElement('input');
       text.setAttribute('name','txt');
       text.setAttribute('type','text');
       text.setAttribute('id','txt');
       text.setAttribute('value','txt');
       text.setAttribute('size','3');
   var cell=document.createElement('td');
       cell.setAttribute('align','center');
       cell.appendChild(text);
   return cell;       
}
function createCellSelect(){
   var erp=new Array(2);
 
   for(var i=0;i       erp[i]="mm"+i;     
   }
   var select=document.createElement('select');
       select.setAttribute('id','mrp');
       select.setAttribute('size','1');
 
      for(var i=0;i       window.alert("erp["+i+"]="+erp[i]);
   var option=null;
       option=document.createElement('option');
       option.appendChild(document.createTextNode(erp[i]));
       option.setAttribute('value','');
        select.appendChild(option);
       }      
     
   var cell=document.createElement('td');   
       cell.setAttribute('align','center');
       cell.appendChild(select);  
   return cell;    
}
 
 
 
阅读(1299) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2008-09-10 14:17:29

http://www.sap99.com/ ,SAP免费资料下载 SAP99资料多多 http://www.sap99.com 有很多的学习资料,推荐一下,