For the selectpicker class, the usual assignment through .attr(attr_name, attr_value) does not work.
It works correctly through $('#myselect').selectpicker({attr_name: attr_value}) .
attr_name - unknown, and received as a variable:
var attr_name = some_value; But! How now to use the VALUE of a variable as an attribute?