开发者

jquery: see if clicked element is select form, and output all the options on a new overlay

i am trying to do something like this in jquery.

if ($(e.target) == "select"){
//var output = $(e.target).each option

//display newoverlay(outp开发者_JS百科ut)
}


How about:

if($(e.target).is('select')) {
    $('option', e.target).each(function() {
        /* "this" is the <option> element in here */
        // newoverlay(this)
    })
}

Although I'm not sure what you want to do with the individual <option> elements.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜