How to remove body background image in jquery

青灯夜游
Release: 2022-04-21 15:24:13
Original
2202 people have browsed it

How to remove the body background image: 1. Use css(), the syntax "$("body").css("background","none");"; 2. Use attr(), the syntax "$("body").attr("style","background:none");".

How to remove body background image in jquery

The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.

Jquery method to remove body background image

Method 1: Use css()

The css() method returns or sets one or more style properties of the matched element.

Use the css() method to directly add a new value "none" to the background attribute and set a new style.




	
		
		
		
		
	
Copy after login

How to remove body background image in jquery

Method 2: Use attr()

Use attr() to set the style attribute and add background:none style, overwrites the old style.




	
		
		
		
		
	
Copy after login

How to remove body background image in jquery

【Recommended learning: jQuery video tutorial, web front-end video

The above is the detailed content of How to remove body background image in jquery. For more information, please follow other related articles on the PHP Chinese website!

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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!