Javascript 获取radiobuttonlist(单选框)的值
Javascript 获取radiobuttonlist(单选框)的值
function check() {
var RadioButtonList1 = document.getElementById('<%=RadioButtonList1.ClientID%>');
var rbs = RadioButtonList1.getElementsByTagName("INPUT");
for(var i = 0;i<rbs.length;i++) {
if (rbs[i].checked) {
var text = RadioButtonList1.cells[i].innerText;
var value=rbs[i].value;
alert(value + text);
}
}
相关文档:
1 JavaScript数组简介
JavaScript数组是一种包含已编码的值的复合数据。数组区别于关联数组,关联数组是将值和字符串关联在一起,而数组是将值和非负整数关联在一起。
数组是对象(可利用typeof运算符)。
2   ......
//关闭,父窗口弹出对话框,子窗口直接关闭
this.Response.Write("<script language=javascript>window.close();");
//关闭,父窗口和子窗口都不弹出对话框,直接关闭
this.Response.Write("");
this.Response.Write("{top.opener =null;top.close();}");
this.Response.Write("");
//弹出窗口刷新当前页面width=20 ......
大家可能都遇到过在写javascirpt代码时传递中文,在后台取到时发现是乱码,这里把我今天做的方法写出来,希望对大家以后有用!
方法(一):
html页面:
function testOne() {
var url = "testOne_test.do?expr="+你好;
location = encodeURI(url);
}
后台java代码:
String expr = ne ......
scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......
(一)aspx页面上的代码片段
<body>
<script language="javascript" type="text/javascript">
function DisplayBehindCode() {
var text="<%=Name()%>";
alert(text);
}
</script>
....
<asp:Button ID ......