How can i disable a select_tag like this example with javascript :
<button onclick="DisableFields()">Disable</button>
<p class="col-lg-2" id ="test1" >
<%=
select_tag(:customer_service_beneficiary_id, options_for_select(customer_service_beneficiary_col) , :class => "form-control")
%>
</p>
I try this but it doesnt work :
function DisableFields() {
console.log('Disable');
$("test1").prop('disabled', true);
$("test2").attr('disabled','disabled');
}