How Do I make Changes in .CSS File Using Jquery Or Javascript?

前端 未结 7 779
既然无缘
既然无缘 2021-01-22 12:27

I would like to know that is there anyway to make changes in .css file using Jquery or javascript. I know, I can dynamically add css properties(or classes) to DOM Element but I

7条回答
  •  情歌与酒
    2021-01-22 12:59

    You cannot do it directly within jQuery, but you can load the .css file with jQuery, edit the contents and then send the data to a php or asp.net page which overrides the .css file with the new contents. But this is very dangerous because people can exploit the code and save any data in that .css file unless you have some security procedure but I can't think of any way you can make that work safely.

提交回复
热议问题