显示标签属性


DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Titletitle>
    <style>
        #show{
            width:600px;
            height: 220px;
            background-color: darkseagreen;
            border: darkgreen 1px solid;
        }

    style>
    <script src="js/jquery-1.11.3.min.js">script>
    <script>
        $(function (){
           var text="";
           text += "DIV宽" + $("#show").width() + "
"; text += "DIV高" +$("#show").height() + "
"; $("#btn").click(function (){ $("#show").html(text); }) }); script> head> <body> <div id="show">div> <button id="btn">显示DIV的尺寸button> body> html>