亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

當我單擊一個單選按鈕時更改布局形式

當我單擊一個單選按鈕時更改布局形式

Cats萌萌 2024-01-18 15:56:48
你好,我是一名學生,最近我正在學習 JavaScript、CSS 和 HTML,在做練習時我遇到了問題。在練習中,我使用 Bootstrap。function Form(stringa){    document.getElementById("form1").style.display="none";            document.getElementById("form2").style.display = "none";     document.getElementById(stringa).style.display = "block"; }<!doctype html><html>  <head>    <title>Form di registrazione</title>  </head>  <body>   <div class="container">     <h1>Form di Registrazione</h1>      <div class="form-check form-check-inline">        <input class="form-check-input" type="radio" name="inlineRadioOptions" value=1 onclick="Form('form1');" >        <label class="form-check-label" for="inlineRadio1">Privato</label>      </div>       <div class="form-check form-check-inline">        <input class="form-check-input" type="radio" name="inlineRadioOptions" onclick="Form('form2'); " value=2>        <label class="form-check-label" for="inlineRadio2">Azienda</label>      </div>      <form id="form1" class="row g-3" value=1>        <div class="col-md-6">          <label for="inputEmail4" class="form-label">Email</label>          <input type="email" class="form-control" id="inputEmail4">        </div>        <div class="col-md-6">          <label for="inputPassword4" class="form-label">Password</label>          <input type="password" class="form-control" id="inputPassword4">        </div>    </form>    <form id="form2" type="hidden"class="row g-3"style="display:none;" value=2>      <div class="col-md-6">        <label for="inputEmail4" class="form-label">Eeeeee</label>        <input type="email" class="form-control" id="inputEmail4">      </div>    </form>    </div>  </body></html>為什么當我單擊單選按鈕時它會更改表單布局?
查看完整描述

1 回答

?
拉風的咖菲貓

TA貢獻1995條經驗 獲得超2個贊

您已經有了 2 種不同的表格。單擊無線電輸入(放置在表單之外?什么?)將運行帶有切換表單顯示的功能。

發生了什么:隱藏一個表單并顯示另一個具有不同數量輸入的表單。


查看完整回答
反對 回復 2024-01-18
  • 1 回答
  • 0 關注
  • 153 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號