-3
我试图将css代码附加到<style>
。追加css代码到<style>
我已经<style>
其中有id
像<style id="custom-css">
,我想单击按钮时追加更多的样式。
$('.btn').click(function(){
$('.class{background:#aaa;}').appendTo('custom-css');
});
我试图将css代码附加到<style>
。追加css代码到<style>
我已经<style>
其中有id
像<style id="custom-css">
,我想单击按钮时追加更多的样式。
$('.btn').click(function(){
$('.class{background:#aaa;}').appendTo('custom-css');
});
这不起作用,你添加文本并将其视为一个元素? – adeneo
是的,我知道它不会工作,我只是举个例子。 – user007
无论你认为你需要这个,不要。如果您需要编辑