如果jquery要选择的元素id中带有点符号,在选择时需要在点前面加上两个反斜杠,如:
$("#address\.street").text("Enter this field");
具体代码如下:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> >
<script type='text/javascript' src='jquery-1.9.1.js'></script>
<script type='text/javascript'>
//<![CDATA[
$(window).load(function(){
//http://www.jb51.net
$("#address\.street").text("Enter this field");
});//]]>
</script>
</head>
<body>
<div id="address.street">
</div>
</body>
</html>
更多信息请查看IT技术专栏