How I can add and remove the attribute "readonly" ?
- by question_about_the_problem
$(document).ready(function() {
//Check City Value
var city_value = parseInt($("#city").val());
if( city_value == 0) {
$("#state").attr("readonly", true);
//$("#rate").attr("readonly", "readonly");
} else {
$("#state").removeAttr("readonly");
//document.getElementById("state").removeAttribute("readonly",0);
//get_states(city_value);
}
/***
//Check State Value
var state_value = parseInt($('#state').val());
if( state_value == 0) {
$('#rate').attr('readonly', true);
} else {
$('#rate').attr('readonly', false);
}
***/
});