Turning off the fields on the site occurs with the styles specifically by the disabled = “disabled” parameter if at the end to write simply disabled nothing happens
& lt; select id = "otdelenie" class = "b-core-ui-select__select" name = "otdelenie" disabled = "disabled" & gt;
& lt; option & gt; Select Post Office & LT; / Option & GT;
& lt; / select & gt;
Question how to install the value disabled = “disabled” in the element using JS in the element.
What is there now, works, but on a clean form without CSS
function gorod_dis () {
Document.getelementByid ('Gorod'). Disabled = True;
}
Function Gorod_en () {
Document.getelementByid ('Gorod'). Disabled = False;
}
Answer 1, Authority 100%
If I understood the question correctly …
disabled = “disabled” is a tag attribute, not style.
Here is an example of installing an attribute to a specific tag.
document.getelementbyid ('otdelenie'). SetAttribute ('disabled', 'disabled')