简体   繁体   中英

jquery string concatenation in selector

i want to concat some string(id) with parent id... so i'v tried this-------------->

$(' #cate_id2 > ul > li:has(ul) ').hover(function () {
                $('#cate_id2 > ul' + this + ' > ul').stop().slideDown('fast');
            },

want to concat #cate_id2 > ul with this and than append > ul ....

string should becomes after execute '#cate_id2 > ul' + li:has(ul) + ' > ul'
i mean li:has(ul) will replaced by with its value.......

Try it like this

$(' #cate_id2 > ul > li:has(ul) ').hover(function () {
    $(this).children('ul').stop().slideDown('fast');
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM