このHTMLマークアップとCSSのセットがあるとしましょう
#CSS
.inputhelp_text { background: #000; color: #fff; }
.nodisplay { display: none; }
<input class="inputhelp" id="firstname" /><span class="inputhelp_text nodisplay" id="help_firstname">Write in your firstname</span>
<input class="inputhelp" id="lastname" /><span class="inputhelp_text nodisplay" id="help_lastname">Write in your lastname</span>
jQueryを使用して、関数をすべての入力フィールドにバインドする必要があります(jQueryのEACH関数を使用していると思います)。これにより、入力フィールドをクリックすると、各スパンのクラスが「inputhelp_text」のみに切り替わります。これは、フィールドごとに 2 つの別々の関数で動作するようになりましたが、多くのフィールドがあるため、それを解決するためのより良い方法があることがわかっています。
助言がありますか?