Home > Web Front-end > JS Tutorial > The solution to adding style to the page with js has no effect_javascript skills

The solution to adding style to the page with js has no effect_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:03:13
Original
1704 people have browsed it

I encountered a problem while working on a project today. My a.jsp introduced b.jsp, and my c.jsp also introduced b.jsp. The style in b.jsp was dynamically changed according to the introduction (in Write js changes in a.jsp and c.jsp). I found a lot of codes online and tried many times, but to no avail. Later, I saw this code, document.getElementById("aa").style.cssText="background:#1175d9;"; (cssText="" you can add the style you need inside the quotes), which solved my problem.

Related labels:
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
Where is js written?
From 1970-01-01 08:00:00
0
0
0
js file code not found
From 1970-01-01 08:00:00
0
0
0
js addClass not working
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template