溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

DIV動(dòng)態(tài)賦值的方法

發(fā)布時(shí)間:2022-03-04 16:17:10 來(lái)源:億速云 閱讀:159 作者:iii 欄目:web開(kāi)發(fā)

這篇文章主要介紹了DIV動(dòng)態(tài)賦值的方法的相關(guān)知識(shí),內(nèi)容詳細(xì)易懂,操作簡(jiǎn)單快捷,具有一定借鑒價(jià)值,相信大家閱讀完這篇DIV動(dòng)態(tài)賦值的方法文章都會(huì)有所收獲,下面我們一起來(lái)看看吧。

  <htmlxmlns="http://www.w3.org/1999/xhtml"> 

  <head> 

  <metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/> 

  <title>js動(dòng)態(tài)設(shè)置div的值.html</title> 

  </head> 

  <body> 

  <formmethod="post"name="form1"> 

    <label><inputtype="radio"name="radio"value="1-10歲"&omicron;nclick="ok(this.value);">1-10歲</label> 

    <label><inputtype="radio"name="radio"value="11歲"&omicron;nclick="ok(this.value);">11歲</label> 

    <label><inputtype="radio"name="radio"value="12-120歲"&omicron;nclick="ok(this.value);">12-120歲</label> 

   </form> 

   <divid="test">11111</div> 

   <scriptlanguage="javascript"type="text/javascript"> 

  functionok() 

  { 

   vartemp=document.getElementsByName("radio"); 

   for(i=0;i<temp.length;i++){ 

   //遍歷Radio 

    if(temp[i].checked) 

     { 

     //alert("你選擇了"+temp[i].value); 

     //獲取Radio的值 

     document.getElementById('test').innerHTML=temp[i].value;//必須如此格式寫,用jquery的獲取值的方式不能達(dá)到效果,ly2013-02-07   

     } 

    } 

  } 

  </script>

  </body> 

  </html>

關(guān)于“DIV動(dòng)態(tài)賦值的方法”這篇文章的內(nèi)容就介紹到這里,感謝各位的閱讀!相信大家對(duì)“DIV動(dòng)態(tài)賦值的方法”知識(shí)都有一定的了解,大家如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

div
AI