1
我有PHP代碼執行一個循環,在其內部會生成以下內容:隱藏以前輸入按鈕
echo "<input type=\"button\" event='$eventID' id=\"sendsomeone\" value=\"Send a family member\"/>";
echo "<span id='$eventID'></span>";
後來,我的JavaScript其中如下:
$('input:button').click(function() {
$(this).next("span").append('You clicked this button!');
}
此代碼工作精細。但我想它也隱藏按鈕(但並不是所有的頁面上的按鈕)
我試着代碼嘴硬像
$(this).parent("input").hide();
和$(this).prev("input").hide();
但我做不到不知道如何使它工作。
這些天,我將不再是貨物邪教編程,我會知道這些令人難以置信的簡單的事情。哇謝謝! – jeremy
沒問題的人。你會得到它的竅門。 – slandau