Home > Web Front-end > JS Tutorial > Code for changing color and background implemented by jquery change(fontsize,background) supplement 2_jquery

Code for changing color and background implemented by jquery change(fontsize,background) supplement 2_jquery

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 18:27:31
Original
1497 people have browsed it

change(fn)
Bind a handler function to the change event of each matching element. The
change event is triggered when an element loses focus, and also when its value changes after gaining focus.


[Ctrl A Select all Note:
If you need to introduce external Js, you need to refresh to execute
]Jquery change( fontsize,background) code to change color and background<script> $(function(){ $('#c-obj select').change(function(){ alert($(this).attr('id') + ': ' + $(this).val()); $('p').css($(this).attr('id'), $(this).val()); //select的ID和要设置的CSS属性值必须保持一致 }); }); </script>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template