how to sum values of selected options using jquery?

后端 未结 2 778
臣服心动
臣服心动 2021-01-03 01:30

Hello i have 3 selectors , all selectors have some options with some values , how to sum all values of selected options ?


                        
    
提交评论

  • 2021-01-03 02:16
       var sum =  parseInt($('select[name="anch1"]').val()) +parseInt($('select[name="anch2"]').val()) +parseInt($('select[name="anch3"]').val() )
    

    You can do this

    0 讨论(0)
  • 提交回复
    热议问题