Js to the page add style ineffective solution

  • 2020-03-30 01:23:32
  • OfStack

Today, I met a problem when I was working on the project. My a.jsp introduced b.jsp, and c.jsp also introduced b.jsp, and the style in b.jsp was changed dynamically according to the introduced changes (js was written in a.jsp and c.jsp). I found a lot of code on the Internet and tried it many times, but it didn't work. Later, you see this code, document.getelementbyid ("aa").style.csstext ="background:#1175d9;" ; (cssText= "" within the quotes you can add your own style), which solved my problem.

Related articles: