0
点赞
收藏
分享

微信扫一扫

Jquery设置select控件指定text的值为选中项

zidea 2023-09-17 阅读 41



北环路
天河路
清华园路
徐寨路
朝凤路
园田路

var street = ‘清华园路’; 
(‘#streetid option:contains(’ + street + ‘)’).each(function(){  
  if ((this).text() == street) { 
 $(this).attr(‘selected’, true); 
 } 
 });

举报

相关推荐

0 条评论