2
我希望點擊旁邊的按鈕來獲取li值。如果點擊蘋果旁邊的按鈕,我應該在一個警告框上得到蘋果。我一直堅持這一天。任何幫助表示讚賞。jquery - 按鈕點擊獲取li值
<ul>
<li>apple<input type="button" value="show">.
<li>jam<input type="button" value="show">.
<ul>
jQuery的
$("input[type=button]").click(function()
{
alert($(this).parent().text());
});