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

WBOY
Release: 2016-05-16 17:03:13
Original
1665 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:
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template