Home > front end >  Layui how to get to beautify the switch after the DOM object, the premise condition need not directl
Layui how to get to beautify the switch after the DOM object, the premise condition need not directl

Time:01-13

Layui how to get to beautify the switch after the DOM object, the premise condition need not directly obtained how to monitor the switch switch?

1. The default to listen to

 
Form. On (' switch (filter) ', function (data) {
The console. The log (data. Elem);//get the checkbox original DOM object
The console. The log (data. Elem. Checked).//whether the switch open, true or false
The console. The log (data. Value);//switch value, also can through the data. Elem. The value for the
The console. The log (data. Othis);//get beautify the DOM object after
});




2. Direct access to the sample
 
//such as access to its values can be like this:
Layui $(test) is (' : checked ');


3. How to directly access?

 

//to get such as how to use js code to...

//thank you
The TKS very much
  • Related