我使用java-script编写动态表单.我想在java脚本中添加样式.我写了一些代码来添加样式.但它没有用.这是我在项目中编写的代码.
var sheet = document.createElement('style');
sheet.type="text/css";
sheet.innerHTML = "body{color:red;}";
document.body.appendChild(sheet);
Run Code Online (Sandbox Code Playgroud)
有人帮我请.
我试图通过以下代码隐藏2000ms后的元素.
setTimeout($templateElement.hide(),2000);
我是jquery和java-script的新人.我希望任何人都清楚我的怀疑.