2015-08-20 31 views
0

我的項目針對的是課程,但遇到問題。根據您的變量定位div

我得到了誰的AHREF

var currentAttrValue = $(this).attr('href'); 

瞄準數這個小變量,這個我創造

$('.accordion ' + currentAttrValue).slideDown(200).addClass('open'); 

但我想使用的結果爲目標內部的段落標記該specefic格從:

('.accordion ' + currentAttrValue)" 

但我不知道如何對目標的第一節應該是這樣的:

('.accordion ' + currentAttrValue 'p') 

但saldy它不工作

回答

3

嘗試:$('.accordion ' + currentAttrValue + ' p')