10 examples of 'disabled toggle' in JavaScript

Every line of 'disabled toggle' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
190function toggledEnable (toggle, widget)
191{
192 toggle = getWidget (toggle);
193 widget = getWidget (widget);
194 if (toggle.selected) {
195 widget.disabled = false;
196 } else {
197 widget.disabled = true;
198 }
199}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

377function toggleDisabled(ele){
378 ele = $(ele);
379 if(ele == null) {return;}
380 ele.disabled = !ele.disabled ;
381}
201function doubleToggledEnable (toggle1, toggle2, widget)
202{
203 toggle1 = getWidget (toggle1);
204 toggle2 = getWidget (toggle2);
205 widget = getWidget (widget);
206 if (toggle1.selected && toggle2.selected) {
207 widget.disabled = false;
208 } else {
209 widget.disabled = true;
210 }
211}
174function toggleDisabled(){
175 disabled=!disabled;
176 forEachButton(function(widget){ widget._setDisabled(disabled); });
177 dojo.byId("toggle").innerHTML= disabled ? "Enable all" : "Disable all";
178}
92function toggleDisabled(from) {
93 for (name in widgets) {
94 var scope = widgets[name];
95 for (name in scope) {
96 var widget = scope[name];
97 if (from == widget) {
98 for (index in scope) {
99 widget = scope[index];
100 if (from != widget) {
101 if (from.checked) {
102 if (widget.hasAttribute('disabled')) {
103 widget.removeAttribute('disabled');
104 }
105 } else {
106 widget.setAttribute('disabled', true);
107 }
108 }
109 }
110 return true;
111 }
112 }
113 }
114 return false;
115}
45function toggle() {
46 var list = document.getElementsByClassName("gwt-TextArea");
47 var button = document.getElementById("hide-console");
48 var console = list[0];
49 if (console.style.display == "block") {
50 console.style.display = "none";
51 console.scrollTop = 99999;
52 button.innerHTML = "show console";
53 } else {
54 console.style.display = "block";
55 console.scrollTop = 99999;
56 button.innerHTML = "hide console";
57 }
58}
10function toggle(toggleId)
11{
12 var toggle = document.getElementById ? document.getElementById(toggleId) : document.all[toggleId];
13 toggle.textContent = toggle.innerHTML == '\u25b6' ? '\u25bc' : '\u25b6';
14}
8function toggle(_btn, _div) {
9 var elem = document.getElementById(_div);
10
11 if(elem.style.display === 'none') {
12 elem.style.display = 'block'
13 _btn.innerHTML = "-";
14 }
15 else {
16 elem.style.display = 'none'
17 _btn.innerHTML = "+";
18 }
19}
117set disabled(disabled)
118{
119 this._element.classList.toggle("disabled", disabled);
120}
270function toggle (bool) {
271 return bool ? false : true;
272}

Related snippets