JavaScript获得表单target属性的方法
本文实例讲述了JavaScript获得表单target属性的方法。分享给大家供大家参考。具体实现方法如下:
<!DOCTYPE html> <html> <body> <form id="frm1" action="form_action.asp" target="_blank"> First name: <input type="text" name="fname" value="Donald"><br> Last name: <input type="text" name="lname" value="Duck"><br> <input type="submit" value="Submit"> </form> <p>The value of the target attribute is: <script> document.write(document.getElementById("frm1").target); </script> </p> </body> </html>
上述代码输出结果如下:
The value of the target attribute is: _blank
希望本文所述对大家的javascript程序设计有所帮助。
相关推荐
jipengx 2020-11-12
EdwardSiCong 2020-11-23
yungpheng 2020-10-19
橄榄 2020-11-03
lyqdanang 2020-11-02
wservices 2020-10-30
onepiecedn 2020-10-29
数据人 2020-10-26
dfphoto 2020-10-16
hackerlpy 2020-09-07
tianyayi 2020-08-16
Dullonjiang 2020-08-15
fengling 2020-08-15
wordmhg 2020-08-06
guotiaotiao 2020-08-06
zhangsyi 2020-07-28
千锋 2020-07-27
ahnjwj 2020-07-28