<!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>
</head>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(function(){
$(":header").css("background-color","#cccccc");
$(":text").val("please input something...").css("color","#666666");
});
if($(":text:focus")){
this.select();
}
</script>
<body>
<h1>title</h1>
<form action="">
<table>
<tr>
<td><input type="text" /></td>
<td><input type="button" value="click"/></td>
</tr>
<tr>
<td><input type="radio" />boy</td>
<td></td>
</tr>
</table>
</form>
</body>
</html>
显示对象不支持该属性的错误提示,14行那我要实现选中,那一行要怎么改才好
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(function(){
$(":header").css("background-color","#cccccc");
$(":text").val("please input something...").css("color","#666666");
});
if($(":text:focus")){
this.select();
}
</script>
<body>
<h1>title</h1>
<form action="">
<table>
<tr>
<td><input type="text" /></td>
<td><input type="button" value="click"/></td>
</tr>
<tr>
<td><input type="radio" />boy</td>
<td></td>
</tr>
</table>
</form>
</body>
</html>
显示对象不支持该属性的错误提示,14行那我要实现选中,那一行要怎么改才好
<!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>
</head>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(function(){
$(":header").css("background-color","#cccccc");
$(":text").val("please input something...").css("color","#666666");
});
if($(":text:focus")){
this.select();
}
$("input[type][value]").val("点击");
$("img[src][width]").attr("src","images/lunbo_title03.gif");
</script>
<body>
<h1>title</h1>
<form action="">
<table>
<tr>
<td><input type="text" /></td>
<td><input type="button" value="click"/></td>
</tr>
<tr>
<td><input type="radio" />boy</td>
<td><img src="" width="" height="" /></td>
</tr>
</table>
</form>
</body>
</html>
$(":header").css("background-color","#cccccc");
$(":text").val("please input something...").css("color","#666666");
$(":text").click( function() {
$(this).select();
});
});
$("img[src][width]").attr("src","images/lunbo_title03.gif");为什么没有效果?就是实现让按钮加上文字和图片加上链接图,两个中括号的语法也是参考jquery说明书的,不会错的,那错在哪?
//中间
})
第一:图片是不是没有找到?
第二:<td><img src="" width="" height="" /></td> width height加上属性值,否则图片显示不出来
还有要区分下 this 和 $(this)的区别