HTML5 给input和textarea HTML标签增加 prompt
下面的例子展示了,如何给INPUT和TEXTAREA标签通过设置attribute。
<!DOCTYPE html> <html> <body> <table> <tr> <th>Username:</th> <td><input id="usrnm" type="email" name="username" placeholder="[email protected]" /></td> </tr> <tr> <th>Password:</th> <td><input id="psswd" type="password" name="password" placeholder="Top secret password" /></td> </tr> <tr> <th>Comments:</th> <td><textarea id="cmmnts" cols="30" rows="5" placeholder="Comments"></textarea></td> </tr> <tr> <td> </td> <td><input id="submitBtn" type="submit" value="Submit" /></td> </tr> </table> </body> </html>
源码下载:
相关推荐
zengni 2020-04-16
Vipwxs 2018-12-19
javaer 2008-09-02
jscjxysx 2019-07-01
冯二爷 2019-07-01
Donutsapps 2019-06-29
无情 2018-12-19
87281248 2017-09-28
原為簡單 2017-09-28
web开发 2017-01-16
勤能补拙孰能生巧 2019-06-28
wndong 2015-12-14
shishaoe 2015-04-10
csstpeixun 2015-04-02
xiaocaibai 2014-12-19
realitycss 2014-05-05
DreamLee 2013-12-13
切慕溪水 2013-07-11
lkj0 2013-05-24