나는 말도 안되는 말을 많이하지 않을 것입니다. 나는 당신에게 키 코드를 게시 할 것입니다. 특정 코드는 다음과 같습니다.
<! doctype html> <html> <head> <metacharset = "utf-8"> <title> 입력 상자 명확한 버튼 </title> <scriptsrc = "js/jquery1.8.3.3min.js"> </script> <script>/*** 현재 입력 상자의 값을 점검하십시오. 비어 있지 않으면 클리어 버튼이 표시됩니다* @param 요소*/functioncheckinput (element) {var value = $ (element) .val (); if (value! = null && ''! = value) $ (요소) .parent (). children (). children (). children ( '. button'). removeClass ( 'none'); elopt (element). parent (). children (). children (). @param element*/functionClearInput (element) {$ (element) .parent (). parent (). children (). children ( 'input'). val ( ''); $ (element) .addclass ( 'none');} <script> <style> .none {display : none;}}. 빨간색; font-size : 18px; 너비 : 100px; 높이 : 18px; 테두리; 경계 : 1px solid red; border-radius : 5px;} </style> </head> <body> <div> <div> <inputtype = "text"placeholder = "enth"try "onkeyup =" "checkinput (this) <divclass = </20"> "</</divicpe = <divclass ="</20 "> 버튼 "onclick ="clearInput (this); "> Clear Input </a> </a> </div> </div> </body> </html> '). addClass ('pre-numbering '). hide (); $ (this) .addclass ('has-numbering ') $ ( '').};위의 것은 편집기가 입력 상자와 명확한 버튼을 구현하기 위해 소개 한 JavaScript의 연결 효과입니다. 모든 사람에게 도움이되기를 바랍니다. 궁금한 점이 있으면 메시지를 남겨 주시면 편집자가 제 시간에 모든 사람에게 답장을 드리겠습니다. Wulin.com 웹 사이트를 지원해 주셔서 대단히 감사합니다!