我需要使用變量的值來顯示文本框。對我而言,我無法完成它的工作。我不是java腳本的專家,所以我正在尋求你的幫助。下面是HTML和Java腳本:使用變量顯示文本框
function valueChanged(me)
{
\t var check_id = me.id + "dt"
\t alert (check_id)
\t
if($('.tour_selected').is(":checked"))
\t \t $(check_id).val.show();
else
$(check_id).val.hide();
}
<input class="t1dt" type="text" name="keywords_other_option" value="" id="t1dt" placeholder=" Select date+time for>" style="display: none">
<input class="tour_selected col-md-1" type="checkbox" name="ATV and Falls " value="ATV and Falls" id="t1" onchange=" return valueChanged(this)">ATV and Falls
<br>
正如你所看到的ID是被串聯和顯示。但是沒有傳入IF函數來取消隱藏文本框。
感謝您的幫助
是要使用jQuery庫或JavaScript? –