var $role_id = btn.parent().prev().prev().attr('id')
var $department_id = btn.parent().prev().prev().prev().attr('id')

$("#modify_user_department option[value = '"+$department_id+"']").attr("selected","selected");
$("#modify_user_role option[value = '"+$role_id+"']").attr("selected","selected");
先value=‘’单引号   在单引号里  加入双引号加号变量。‘“+$department_id+”’

参考自:https://zhidao.baidu.com/question/1689765815733075548.html

相关文章:

  • 2022-01-21
  • 2021-06-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-12-10
  • 2021-11-17
猜你喜欢
  • 2021-08-10
  • 2022-12-23
  • 2022-12-23
  • 2021-07-22
  • 2021-09-21
  • 2021-10-10
相关资源
相似解决方案