87,989
社区成员
发帖
与我相关
我的任务
分享
<c id =<%= i%> name="show">
<b id=<%=m%>>
<a href="#" style="abc">
</a>
</b>
</c>
<script type=text/javascript>
function ok() {
document.getElementByName("show").
}
</script>
<html>
<head>
<title></title>
<script>
function ok() {
var style = document.getElementsByName("show")[0].getElementsByTagName('a')[0].getAttribute('style');
alert(style);
}
</script>
</head>
<body>
<input type='button' value='button' onclick="ok()" />
<c name="show">
<b >
<a href="#" style="abc">
</a>
</b>
</c>
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<title>?</title>
<style type="text/css">
div{float:left;border:#000 solid 1px;width:100px;height:100px;}
</style>
</head>
<body>
<c name="show" style="dsadsadsa">
<b>
<a id ="name" href="#" style="abc" onclick="ok()">asdasdasdasd
</a>
</b>
</c>
<script type=text/javascript>
function ok(){
var style= document.getElementsByName("show")[0].getElementsByTagName('a')[0].getAttribute('style');
alert(style);
}
</script>
</body>
</html><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>find a style Page</title>
</head>
<script type="text/javascript" language="javascript">
function getStyle() {
var style="abc";
// style=""; 我想找到a标签的style属性,请html之父老胡提供想法
var a=document.getElementsByTagName("a")[0];
alert(a.getAttribute("style").cssText||a.getAttribute("style"));
}
</script>
<body>
<div name="show">
<b>
<a href="#" style="background:#ffffff;">abc</a>
</b>
</div>
<input type='button' value='button' onclick="getStyle()" />
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script>
$(function(){
alert($('c a')[0].style.color)
})
</script>
</head>
<body>
<c id ='' name="show">
<b id=''>
<a href="#" style="color:red;">1121
</a>
</b>
</c>
</body>
</html>
function ok(){
var style= document.getElementsByName("show")[0].getElementsByTagName('a')[0].getAttribute('style');
alert(style);
}