change/modify the dropdownlist text by value using jquery

后端 未结 2 914
故里飘歌
故里飘歌 2021-02-05 12:36

i have dropdownlist with the values:


                        
    
提交评论

  • 2021-02-05 13:01
    var myDLLField = $('select[id="myddl"]');
    myDLLField.find('option[value="2"]').text("Two");   
    

    or, in one line...

    $('select[id="myddl"]').find('option[value="2"]').text("Two");  
    
    0 讨论(0)
  • 提交回复
    热议问题