有关datalist的问题
鼠标点击datalist怎么获当前行的值,我以前用gridview做过会做
- C# code
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { string name = e.Row.Cells[0].Text.Trim(); e.Row.Attributes.Add("onclick ", " window.returnValue='" + name + "';window.close();"); if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate) { //鼠标经过时,行背景色变 e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#E6F5FA'"); //鼠标移出时,行背景色变 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#DEDFDE'"); } } }但是用datalist不知道用鼠标点击怎么获取当前行的值,请指教。。
[解决办法]
document.getElementById(this).innerHTML
[解决办法]
???对了得到他干什么啊,给谁啊