Home>Article>Web Front-end> How to remove the background of div with jquery
Two methods: 1. Use css() to set the background attribute, the syntax is "$("div").css('background','none')"; 2. Use attr() to add a new background Style, syntax "$("div").attr('style','background:none')".
The operating environment of this tutorial: windows7 system, jquery3.2.1 version, Dell G3 computer.
Two ways to remove div background with jquery:
##Method 1. Use css()
Use css() to set the background attribute of the div element, the value is none##2. Use attr()hello
Use attr() to set the style attribute for the div element and add the background:noney style.
hello
【Recommended learning:
jQuery video tutorialThe above is the detailed content of How to remove the background of div with jquery. For more information, please follow other related articles on the PHP Chinese website!