JavaScript基本的使用

 

 1 <!DOCTYPE html>
 2 <html lang="en">
 3 <head>
 4     <meta charset="UTF-8">
 5     <title>Title</title>
 6 </head>
 7 <body>
 8     <input type="text" id="user">
 9     <input type="button" onclick="GetData();" value ="点我"/>
10     <script>
11         function GetData() {
12             var i = document.getElementById('user');
13             alert(i.value);
14         }
15     </script>
16 </body>
17 </html>
S12.html

 

posted @ 2017-11-23 15:18  颜言  阅读(112)  评论(0编辑  收藏  举报