【Ajax-javaScript】1、javascript的基础学习

前端之家收集整理的这篇文章主要介绍了【Ajax-javaScript】1、javascript的基础学习前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <title>getElementById.html</title>
  5. <Meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  6. <Meta http-equiv="description" content="this is my page">
  7. <Meta http-equiv="content-type" content="text/html; charset=UTF-8">
  8. <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
  9.  
  10. </head>
  11. <body>
  12. <form name="form1" action="test.html" method="post" >
  13. <input type="text" name="username" value="国庆六十周年_1" id="tid" onchange="" >
  14. <input type="button" name="ok" value="保存1" />
  15. </form>
  16. </body>
  17. <script type="text/javascript">
  18. //输出<input type="text" name="username" value="国庆六十周年_1" id="tid">标签value属性的值
  19. var inputElement=document.getElementById("tid");
  20. alert(inputElement.value);
  21. //输出<input type="text" name="username" value="国庆六十周年_1" id="tid">标签type属性的值
  22. alert(inputElement.type);
  23. </script>
  24. </html>
  1. </pre><pre name="code" class="html">


就是很简单的得到相应的标签!!!

大家随意看一看就可以了

猜你在找的Ajax相关文章