0
我需要能夠得到來自手風琴項目href值,我只是點擊我假定這將(其使用Twitter的崩潰插上)得到一個值超出show.bs.collapse Twitter的引導的
工作鏈接:
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" class="accorLink">
抓住它:
$('#accordion').on('show.bs.collapse', function() {
console.log('foo');
var sectionID = $(this).attr("href");
console.log(sectionID);
})
,但它不工作,只是記錄 「未定義」
我能夠從中得到一個理想值,其返回undefined
是因爲你想提取不存在,因爲this
指#accordian
DIV的href
屬性值將href
這是因爲'this'指'#DIV accordian'這 –