這是我的代碼,為什么點(diǎn)擊確定沒有反應(yīng),本人小白,求幫助,這是網(wǎng)上扒的代碼,js表示不太會(huì),只是需要這個(gè)功能,求大神教導(dǎo)js怎么把值傳過去<!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=utf-8" /><title>Radio切換效果</title></head><body><style type="text/css">?fieldset{width:378px;border:1px #B0C0D1 solid;padding:10px;}?legend{background:#B0C0D1;padding:4px 10px;color:#fff;}?#c{margin-top:10px;}?.c1,.c2{width:378px;line-height:20px;}?.c1{color:#014CC9;}?.c2{color:#7E6095;}?h3{font-size:16px;padding:5px 0;}?.red{color:#BD0A01;}</style><script type="text/javascript">function radioShow(){?var myradio=document.getElementsByName("myradio");?var div=document.getElementById("c").getElementsByTagName("div");?for(i=0;i<div.length;i++){? if(myradio[i].checked){? ?div[i].style.display="block";? ?}? ?else{? ?div[i].style.display="none";? ?}? }?}</script><form name="ck"><fieldset>?<legend>修改頁面</legend>? <label for="r1" class="red"><input name="myradio" id="r1" type="radio" value="" checked="checked" onclick="radioShow();" />飯店介紹</label>? <label for="r2" class="red"><input name="myradio" id="r2" type="radio" value="" onclick="radioShow();" />菜品介紹</label><div id="c">?<div class="c1">?<form action="{:U('Index/modify')}" method="post"><lable for="attr"><input type="radio" name="attr" value="特價(jià)" >特價(jià)<input type="radio" name="attr" value="金牌" >金牌</lable><br/><lable for="name">飯店名稱:<input type="text" name="name" value="{$rest.name}"/></lable><br/><lable for="id"><input type="hidden" name="id" value="{$rest.id}"></input></lable><br/><lable for="type">飯店分類:<select name="type"><option value="{$rest.type}">{$rest.type}</option><option value="西餐">西餐</option><option value="火鍋">火鍋</option></select></lable><br/><lable for="phone">電話<input type="number" name="phone" value="{$rest.phone}"/></lable><br/><lable for="area">所在區(qū):<select name="area"><option value="道里區(qū)">道里區(qū)</option><option value="道外區(qū)">道外區(qū)</option><option value="南崗區(qū)">南崗區(qū)</option></select></lable><br/><lable for="address">詳細(xì)地址:<input type="text" name="address"value="{$rest.address}" /></lable><br/><lable ><input type="submit" value="確定"/><input type="reset" value="重寫" /></lable><br/></form>??</div>?<div class="c2" style="display:none;">?<label for="js"><input name="c3" id="js" type="checkbox" value="" />JavaScript</label>? <label for="hd"><input name="c3" id="hd" type="checkbox" value="" />HTML DOM</label>? <label for="dhtml"><input name="c3" id="dhtml" type="checkbox" value="" />DHTML</label>? <label for="vbs"><input name="c3" id="vbs" type="checkbox" value="" />VBScript</label>? <label for="ajax"><input name="c3" id="ajax" type="checkbox" value="" />AJAX</label>? <label for="e4x"><input name="c3" id="e4x" type="checkbox" value="" />E4X</label>? <label for="wml"><input name="c3" id="wml" type="checkbox" value="" />WMLScript</label>?</div></div></fieldset></form></body></html>
Javascript傳值問題
初學(xué)乍練2
2016-11-15 10:27:29