次のようなHTMLがあります
<select id="day"><option>Day</option></select>
<select id="month"><option>Month</option></select>
<select id="year"><option>Year</option></select>
<img src="img/some-icon.png" id="datepicker" />
$("#datepicker").datepicker()
上のアイコンにバインドできません。カレンダーが表示されないだけです。
JQuery UI の例では、常に datepicker を入力フィールドにバインドします。これを達成する別の方法はありますか?
編集:現在、多くの人が以下に提案しているように、隠しフィールドを使用しています。隠しフィールドの使用を避ける方法があるかどうか知りたかっただけです