체크박스 <input> 요소를 생성합니다.
체크박스는 checked() 메서드를 통해 p5.Element 클래스를 확장합니다. myBox.checked()는 박스가 체크되어 있다면 true를, 체크되어 있지 않다면 false를 반환합니다.
첫 번째 매개변수 label은 선택적(optional)입니다. 이는 체크박스 옆에 나타날 레이블을 설정하는 문자열입니다.
두 번째 매개변수 value 역시 선택적입니다. 이는 체크박스의 값을 설정하는 불리안입니다.
예제
구문
createCheckbox([label], [value])
매개변수
label
String:
체크박스 옆에 표시될 레이블
value
Boolean:
체크박스의 값. 체크되어 있으면 true 체크되어 있지 않으면 false
Returns
p5.Element: 새로 생성된 p5.Element 객체
This page is generated from the comments in src/dom/dom.js . Please feel free to edit it and submit a pull request!