猿问

attr( )方法为什么不能获取 <input type="button" />的宽高?

</script>

        <style type="text/css">

            input{width:100px;height:70px;color: red;background-color: azure;}

        </style>

        <script type="text/javascript">

            $(function() {

                $("input").click(function() {

                    alert($("input").attr("width","height"));


                })


            })

        </script>


    </head>


    <body>

        <input type="button" value="显示"/>

        

    </body>

守着一只汪
浏览 558回答 1
1回答
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答