私はそれほどナンセンスとは言いません、私はあなたに重要なコードを投稿するだけです。特定のコードは次のとおりです。
<!doctype html> <html> <head> <metacharset = "utf-8"> <title>入力ボックスクリアボタン</title> <scriptsrc = "js/jquery1.8.3.min.js"> </script> <script>/***現在の入力ボックスの値を確認します。空でない場合、クリアボタンが表示されます* @param要素*/functioncheckinput(element){var value = $(element).val(); if(value!= null && ''!= value)$(element)。parent()。parent()。子供()。子供()。子供( '。ボタン') Element*/functionClearInput(element){$(element).parent()。parent()。children( 'input')。val( ''); $(ement).addclass( 'none');} </script> <style> .none {display:none;}。height-20 {height:height:20px ;;}。赤;フォントサイズ:18px;幅:100px; height:18px; border:1px solid red; border-radius:5px;} </style> </head> <body> <body> <div> <inputtype = "text" placeholder = "try" ent "ent" onekeup = "checkinput(this); button "onclick =" clearInput(this); "> clear input </a> </div> </div> </body> </html> ')。addclass(' pre-numbering ')。hide(); $(this).addclass(' hasnumbering ')。 $ numbers.( '')。上記は、編集者が入力ボックスとクリアボタンを実装するために紹介したJavaScriptのリンケージ効果です。私はそれが誰にでも役立つことを願っています。ご質問がある場合は、メッセージを残してください。編集者は、すべての人に時間内に返信します。 wulin.comのウェブサイトへのご支援ありがとうございます!