单选按钮取值问题!!!!!!

单选按钮取值问题!!!!!!,第1张

<html>

<head>

<script type="text/javascript">

function test(){

var arr=documentgetElementsByName("test");

var sel;

for(var i=0;i<arrlength;i++){//遍历所有单选

if(arr[i]checked){//取出选中的值

sel=arr[i];

}

}

if(selvalue=="a"){//根据逻辑判断

location="ahtml";

}else if(selvalue=="b"){

location="bhtml";

}

}

</script>

</head>

</head>

<body>

<input type="radio" id="a" value="a" name="test">a

<input type="radio" id="b" value="b" name="test">b<br>

<input type="button" value="跳" onclick="test()">

</body>

</html>

alert($("fare input[checked=checked]")val())或者alert($("fare input[checked=true]")val())或alert($("fare input[checked]")val())

<from name="from" action="提交到的地址" >

<input type="radio" name="radio" value="值">

<input type="image" src="按钮的">

</from>

制作一个表单,提交到处理的asp页面

radio=requestfrom("radio")

在asp处理也通过上面获取name为radio的单选框的value值,然后进行相应的处理就行了。

以上就是关于单选按钮取值问题!!!!!!全部的内容,包括:单选按钮取值问题!!!!!!、jquery 获取某个class下单选按钮的值、asp中如何单击button按纽,获取单选按钮的值等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/9586953.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-29
下一篇 2023-04-29

发表评论

登录后才能评论

评论列表(0条)

保存