开发者

Changing styles of page using JS and CSS?

开发者 https://www.devze.com 2023-01-21 15:30 出处:网络
I am trying to CSS assigned inside the head tag开发者_如何转开发 using JS, its not working for IE any idea why? IE just show\"Unknown runtime error\".

I am trying to CSS assigned inside the head tag开发者_如何转开发 using JS, its not working for IE any idea why? IE just show "Unknown runtime error".

<html>
<head>
<style id="style_id" type="text/css">
</style>
</head>
<body>
<p>This is the test Text</p>
</body>
<script>
    var st = document.getElementById("style_id");
    st.innerHTML = "p { color:red}";
</script>
</html>


Are you looking for this one?

0

精彩评论

暂无评论...
验证码 换一张
取 消