用的是jq1.32
如何弹出样式为a的dom的innerHTML
<!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=gb2312" /> 
<title></title> 
<script language="javascript" src="jquery.js"> </script>
<style type="text/css">
.a{
background-color:#0000FF;
}
.b{
font-size:16px;
}
</style>
</head> <body>
<div id = "div" class="a">vvvvvvvvvvvvvv</div>
<script language="javascript">
alert($(".a").innerHTML);
</script>
</body> 
</html> 

解决方案 »

  1.   

    找出页面中控件的class=".a"的控件
      

  2.   


    <!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=gb2312" /> 
    <title></title> 
    <script language="javascript" src="jquery.js"> </script>
    <style type="text/css">
    .a{
    background-color:#0000FF;
    }
    .b{
    font-size:16px;
    }
    </style>
    </head> <body>
    <div id = "div" class="a">vvvvvvvvvvvvvv</div>
    <script language="javascript">
        alert($(".a").html());
    </script>
    </body> 
    </html> 
      

  3.   

    <script language="javascript">
        alert($("#div").innerHTML);
    </script>也可以:<script language="javascript">
        alert(document.getElementById("div").innerHTML);
    </script>
      

  4.   


    <!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=gb2312" /> 
    <title></title> 
    <script language="javascript" src="jquery.js"> </script>
    <style type="text/css">
    .a{
    background-color:#0000FF;
    }
    .b{
    font-size:16px;
    }
    </style>
    </head> <body>
    <div id = "div" class="a">vvvvvvvvvvvvvv</div>
    <script language="javascript">
        alert($(".a").html());
    </script>
    </body> 
    </html>