Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

JavaScript: Cycle through three-state checkbox states

HTML:
<!-- Inline click handler, just for demo -->
<input type="checkbox" id="cb1" onclick="ts(this)">

JS: 
function ts(cb) { // This should show the states in the following order and cycle through them: checked, indeterminate, off.
  if (cb.readOnly) cb.checked=cb.readOnly=false;
  else if (!cb.checked) cb.readOnly=cb.indeterminate=true;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: react sate and props 
Javascript :: sol.common.MapTable elo 
Javascript :: palindrome short way 
Javascript :: electron write to csv 
Javascript :: routing/switches 
Javascript :: react_devtools_backend.js:4026 Warning: Cannot update a component (`BrowserRouter`) while rendering a different component (`Login`). 
Javascript :: board in javascript 
Javascript :: arithmetic 
Javascript :: give call suggestions while clicking on a contact number in next js 
Javascript :: what does the symbol function do in javascript 
Javascript :: JavaScript get div height dynamically without jQuery 
Javascript :: path.join javascript one folder above 
Javascript :: javascript remove the second to last character of a string 
Javascript :: NavBar with divs 
Javascript :: winston transport file another directory 
Javascript :: expact 
Javascript :: backbone view initialize 
Javascript :: country select dropdown javascript 
Javascript :: ES6 reactjs problems 
Javascript :: nested object in javascript 
Javascript :: jsdoc default value 
Javascript :: use of prototype in javascript 
Javascript :: how to convert string into int js 
Javascript :: jwt_access_secret generator 
Javascript :: lodash sum array of objects 
Javascript :: usecontext multiple provider 
Javascript :: how to save data in javascript 
Javascript :: Convert to String Explicitly 
Javascript :: javascript Passing Parameter as Default Values 
Javascript :: random number 1-3 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =