How to customize the options for checkbox?

clipboard.png

how does this define options?

Oct.22,2021

you can write a checkbox, yourself or hide the default style and replace


with your own style. If you want to edit the label value of checkbox , then you can give you some ideas:
you can use a div to wrap checkbox text, and then use the dom action to change label < How to trigger the dom action? There are many forms, for example, you can add a button , click to trigger, or directly add a click event to the dom node of the text, which is triggered by clicking.


---html

<input  id="checkbox" type="checkbox" />
<label for="checkbox">
    <span></span>
    <span></span>
</label>

----css

    input{
        display: none;
    }
    
    label span{
        display: inline-block;
    }
    label span:first-child{
        width: 10px;
        height: 10px;
        background-color:-sharp000;
    }
    input:checked +label>span:first-child{
        background-color:red;
    }

label{
Menu