本文介绍了单击按钮时使用脚本(如何添加五个复选框,五个名称和五个图像)的ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的aspx页面中有一个按钮.
单击该按钮时,我必须一个接一个地获得5个复选框和5个名称和5张图像...我该怎么做.

I have one button in my aspx page.
When click that button I have to get 5 check boxes and five names and five images one by one... how can I do this.

推荐答案



function CreateCheckBox()
{
//Create table
    var tbl = document.createElement('table');
    tbl.border = "1";

    //create a row
    var row = document.createElement('tr');
    row.className = 'gridrow';

    //create td element
    td = document.createElement('td');
    td.className = 'gridcell';
    td.style.fontWeight = 'normal';
    td.rowSpan = 1;
    td.style.width = '80px';

    //create checkbox in that td element
    var chkbox = document.createElement('input');
    chkbox.type = "checkbox";
    chkbox.id = "chk" ;
    chkbox.name = "chk" ;

    //add checkbox to td element
    td.appendChild(chkbox);

    td1 = document.createElement('td');
    var lbl = document.createElement('input');
    lbl.type = "text";
    lbl.id = "lbl1";
    lbl.name = "lblName";
    lbl.value = "vivek";
    lbl.border = "0";
    td1.appendChild(lbl);
    //add td element to row
    row.appendChild(td);
    row.appendChild(td1);

    tbl.appendChild(row);
    
    form1.appendChild(tbl);
}


这篇关于单击按钮时使用脚本(如何添加五个复选框,五个名称和五个图像)的ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 12:23