$(document).ready(function(){ $('th[class="subject common"]').each(function(){ get_href=$(this).find('a').attr("href"); new_ele = $("<button type='button'>test</button>"); new_ele.click(function(){ alert(get_href); }); $(this).append(new_ele); }); });
歡迎光臨 jsGears.com 技術論壇 - AJAX, JavaScript, jQuery, 網站開發, 前端效能優化 (http://www.jsgears.com/) |