<button onclick="javascript:document.getElementById('btn2').disabled=false">按钮1</button>
<button id="btn2" disabled="disabled">按钮2</button>
html一行有多个radiobutton,选中单选按钮元素二提交,用HTML来实现RadioButton,需要使用input标签,其中type指定为radio,处理多个提交按钮的最佳方法是在服务器脚本中使用switch case<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<input type="button" value="Pic1">
<input type="button" value="Pic2">
<input type="button" value="Pic3">
<div></div>
<script>
var picUrl=["https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3305420452,3910104108&fm=11&gp=0.jpg","https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3332919492,3203839407&fm=23&gp=0.jpg","https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=4245887956,100740587&fm=23&gp=0.jpg"]
var i=0
$("input").click(function(event) {
i=$("input").index($(this))
$("div").html("<img src='"+picUrl[i]+"'>")
})
</script>
</body>
</html>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)