get selected="selected" text with jquery

This question already has an answer here:

  • Get selected text from a drop-down list (select box) using jQuery 28 answers

  • Well, you can put them in an array

    var arr = $('option:selected').map(function(){ return $(this).text() }).get();
    // arr[0] = 1
    // arr[1] = 4
    // arr[2] = 8
    

    I suppose it's multi select.

    链接地址: http://www.djcxy.com/p/29298.html

    上一篇: 有没有办法从这里获得{{org}}的价值?

    下一篇: 使用jquery获得selected =“selected”文本