原意是想显示出这样的东西:herf:## target:_blank ...
<script runat="server">
sub Page_Load
if Page.IsPostBack then
Dim i
            For i = 0 To kk.Attributes.Keys.Count
                hh.Text = hh.Text & i & ":" & kk.Attributes(i)
            Next

end if
end sub
</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title> new document </title>
<meta name="keywords" content="">
<meta name="description" content="">
</head> <body>
<form runat="server">
<a href="" target="_blank" runat="server" id="kk" class="ff">adfsdf</a>
<br />
<asp:Button id="b1" Text="Submit" runat="server" /><br />
<asp:Label id="hh" runat="server" />
</form>
</body>
</html>

解决方案 »

  1.   

    VB................... <script type="text/javascript">
            window.onload=function(){
                var item = document.body.getElementsByTagName("input");
                for(var i=0;i<item.length;i++){
                    alert(item[i].type)
                }
            }
        </script>
      

  2.   

    我要的是遍历.net里面的Attributes
      

  3.   

    怎样遍历这个Attributes呢?c#的也行
      

  4.   

    我想知道的是,怎样遍历<a href="" target="_blank" runat="server" id="kk" class="ff">adfsdf</a>这个html控件的Attributes
      

  5.   

     for (int i = 0; i < this.Controls.count; i++)
                    {
                        if(如果控件是button)
                        {
                        Button button= this.FindControl(this.Controls.id) as Button;
                        if (button!=null)
                        {
                         button.属性;   
                        }  
                         如果是其他控件 也是如此
                        }
                    }
      

  6.   

    好像就没有访问Html控件Attributes的接口,仅提供了css属性的
      

  7.   

    AttributeCollection ac = div1.Attributes;
    IEnumerator key = ac.Keys.GetEnumerator();
    if (key != null)
    while (key.MoveNext())
    Response.Write(key.Current.ToString() + ":" + ac[key.Current.ToString()] + "<br/>");