js、javascript取得name属性值代码

作者:小胖吴 | 创建时间: 2023-04-23
js、javascript取得name属性值代码

操作方法

js、javascript取得name属性值代码        定义和用法        name 属性可设置或返回按钮的名称。        语法        buttonObject.name=name实例        下面的例子可返回按钮的名称:        <html>        <body>        <button id="button1" name="button1">        Click Me!</button> http://t.qq.com/caipiao99c http://t.qq.com/caipiao101 http://t.qq.com/zaixian101 http://t.qq.com/quyingpt <p>The name of the button is:        <script type="text/javascript">        x=document.getElementById('button1');        document.write(x.name);        </script></p>        </body>        </html>        //The name of the button is: button1

点击展开全文

更多推荐