Select the checkbox radio select summary

Html property is referred to as the attribute, can be set and obtained by setAttribute and getAttribute.

Properties on the checkbox checked when first setting will immediately become selected. Such as:

1. directly on the html. <Input type = "checkbox" checked>

2. set by setAttribute (, "" "checked") any value, it can be turned into a selected state. But take effect only once in the first, no matter how set the value back, chebox the selected state will not change.

State checkbox by js change can dom.checked = true | to set false.

dom properties property can be accessed directly by dom.

dom on the property and some of the attribute may correspond to some completely unrelated, this to be studied.

E.g. jquery attr is the corresponding attribute of the html,

prop is the corresponding property on dom

 

Vue summarized in checkbox    

In the <input type = "checkbox" v-model = "ball" value = "football"> football <input type = "checkbox" v-model = "ball" value = "basketball"> Basketball <input type = "checkbox" v-model = "ball" value = "header"> header <input type = "checkbox" value = "puck" v-model = "ball"> puck

The value of the ball is an array, is selected chekbox of value, the array order is worth checkbox selected order.

Guess you like

Origin www.cnblogs.com/chillaxyw/p/11802692.html