简体   繁体   中英

Problem with getElementsByTagName in IE 8

I have problem this script dont working in IE 8 in Firefox is everything OK.

<html>
<style type="text/css">
 lip{   position:absolute;     }
</style>
<body>
<ul><lip>3<input type = "checkbox" name = "LH3" id ='lhpz12' value="ANO"></lip></ul>
<script type="text/javascript">
var listElements = document.getElementsByTagName("lip");
var element = listElements[0];
    element.style.fontSize = "24px";
    element.style.color = "green";
    element.style.left = "100px";
    element.style.top = "100px";
</script>
</body>
</html> 

LIP不是有效的标签,请使用span或div之类的内容。

In IE, those tags aren't until you create one in JavaScript. You should use a span here.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM