3 メソッド: 1. ラジオ ボックスの selected 属性を削除するには、removeAttr() を使用します。構文は、「radio button object.removeAttr("checked");」です。 2. attr() を使用して、checked 属性の値を false に設定します (構文は「object.attr("checked",false)」です。 3. prop() を使用して、checked 属性の値を false に設定します。構文は「object.prop( "checked",false)」です。
このチュートリアルの動作環境: Windows7 システム、jquery3.6.0 バージョン、Dell G3 コンピューター。
jquery でラジオ ラジオ ボタンの選択状態を削除する 3 つの方法
方法 1:removeAttr()を使用する
ラジオ ラジオ ボタンの選択状態は、checked 属性によって制御されます。この属性を削除するには、removeAttr() を使用するだけです。
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <script src="js/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("input").removeAttr("checked"); }); }); </script> <style> p{ width: 200px; height: 100px; border: 1px solid #AFEEEE; background-color: #AFEEEE; } </style> </head> <body> <input type="radio" name="radio1" value="value1" />选项1<br> <input type="radio" name="radio1" value="value2" checked />选项2<br> <input type="radio" name="radio1" value="value3" />选项3<br><br> <button>去掉radio选中状态</button> </body> </html>
方法 2: attr() を使用する
attr() を使用して、ラジオの selected 属性を設定することもできます。ラジオ ボタン ラジオの選択を解除するには、値 false を使用します。
$(document).ready(function(){ $("button").click(function(){ $("input").attr("checked",false); }); });
方法 3: prop() を使用する
prop() を使用して、ラジオの selected 属性を設定することもできます。ラジオボタンの値が false です。
$(document).ready(function(){ $("button").click(function(){ $("input").prop("checked",false); }); });
[推奨学習: jQuery ビデオ チュートリアル 、Web フロントエンド ビデオ ]
以上がjqueryでラジオボタンの選択状態を解除する方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

classSeLectorEreusableformultipleElements、whiledselectorectorsareuniqueandusedonceperpage.1)クラスは、byperiod(。)、areideal forstylingmultipleementslikebuttons.2)、ids(#)、aerpectforuniqueelementslikeanivigationmenu.3)idshsheaveavehe.3)を示します

CSSスタイルでは、プロジェクトの要件に従ってクラスセレクターまたはIDセレクターを選択する必要があります。1)クラスセレクターは再利用に適しており、同じスタイルの複数の要素に適しています。 2)IDセレクターは一意の要素に適しており、優先度が高いが、メンテナンスの困難を避けるためには注意して使用する必要があります。

html5hasseverallimitationsincludingluding foradvancedgraphics、basicformvalidation、cross-browsercompatibilityissues、performurympacts、andsecurityconcerns.1)forcomplexgraphics、html5'scanvasisisuffish、resiclirarielikelikelikeweblorthree.2)i

はい、ounestylecanhavemorepiritythananincssduetsificity andthecascade.1)dipitiesalityactsasascoringsystemwheremorepifictoreshavehigherpriolity.2)thecascadedededereminesstytyleapplication order、

theSignificAntgoalsofhtml5aretoenhancemultimediasupport、Humanreadability、維持、Andensurebackwardcompativecivity.1)html5improvesmultimediawithnativeelementslikeand.2)ituseSseSseSseSseSseSseSseSseSseSmanticeForementionforementionforementionforementionforementionforemention foremantemention

raceslimitationsinclude:1)asteeplearningcurveduetoitsvastecosystem、2)seochallengeswithsclient-siderEndering、3)潜在的なパフォーマンスのinlargeapplications、4)complenstatemanagementasappsgrow、and5)suneedtokeepupwithovolution

ReactisChallengingを使用して、SteepLearNdParadigMshiftOconpontenAchitecture.1)startisofficialdocumentation forasolidfoundation.2)relondingjsxandjavascriptwithinit.3)LearntousefunctionalcompotontiTateを理解してください

coreChallengeingEneratingは、duniqueys consinistinsidentifientiversre-renderseforeffiencedomupdates.1)aseenaturalKeysisisisisisisisedisederiableiableiaibuniqueandStable.2)denatekeysBaseTheBasedOnMultipreattributive.2)を無効にすることを非難することを解決します


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

VSCode Windows 64 ビットのダウンロード
Microsoft によって発売された無料で強力な IDE エディター

SublimeText3 中国語版
中国語版、とても使いやすい

mPDF
mPDF は、UTF-8 でエンコードされた HTML から PDF ファイルを生成できる PHP ライブラリです。オリジナルの作者である Ian Back は、Web サイトから「オンザフライ」で PDF ファイルを出力し、さまざまな言語を処理するために mPDF を作成しました。 HTML2FPDF などのオリジナルのスクリプトよりも遅く、Unicode フォントを使用すると生成されるファイルが大きくなりますが、CSS スタイルなどをサポートし、多くの機能強化が施されています。 RTL (アラビア語とヘブライ語) や CJK (中国語、日本語、韓国語) を含むほぼすべての言語をサポートします。ネストされたブロックレベル要素 (P、DIV など) をサポートします。

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

Dreamweaver Mac版
ビジュアル Web 開発ツール
