Posted on 2011-11-27 22:00
哈希 阅读(186)
评论(0) 编辑 收藏 所属分类:
Js and Jquery 常用总结
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<script language="javascript">
function showBaby()
{
var path=window.showModalDialog("花园baby.html","","dialogWidth:400px;dialogHeight:400px");
document.getElementById("img").innerHTML="<img src='"+path+"' width='300' height='300'>";
}
</script>
<a href="javaScript:showBaby()">我喜欢...</a>
<p id="img">
</p>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form id="babyFrm" name="babyFrm" method="post" action="">
<table width="471" height="405" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="imgs/[叮叮车].jpg" width="150" height="150" /><br />
<input name="gb" type="radio" value="imgs/[叮叮车].jpg" checked="checked"/>
叮叮车 </td>
<td><img src="imgs/[唔西·迪西].jpg" width="150" height="150" /><br />
<input type="radio" value="imgs/[唔西·迪西].jpg" name="gb"/>
唔西·迪西</td>
<td> </td>
</tr>
<tr>
<td><img src="imgs/[汤姆布利柏].jpg" width="150" height="150" /><br />
<input type="radio" value="imgs/[汤姆布利柏].jpg" name="gb"/>
汤姆布利柏 <br /></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="2" align="center"><input name="btnOk" type="button" id="btnOk" value="我选好了" onclick="selectOk()"/></td>
<td> </td>
</tr>
</table>
</form>
<script language="javascript">
function selectOk(){
//得到所有的单选按钮,返回被选中的按钮的value
var gbs=document.getElementsByName("gb");
var value;
for(var i=0;i<gbs.length;i++){
if(gbs[i].type=="radio" && gbs[i].checked){
value=gbs[i].value;
break;
}
}
window.returnValue=value;
window.close();
}
</script>
</body>
</html>