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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>getElementById.html</title>
	
    <Meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <Meta http-equiv="description" content="this is my page">
    <Meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

  </head>
  
  <body>
  	<form name="form1" action="test.html" method="post" >
  		<input type="text" name="username" value="国庆六十周年_1" id="tid" onchange="" >
  		<input type="button" name="ok" value="保存1" />
  	</form>    
  </body>
  <script type="text/javascript">
  //输出<input type="text" name="username" value="国庆六十周年_1" id="tid">标签value属性的值
  	
  	var inputElement=document.getElementById("tid");
  	alert(inputElement.value);
  
  
  //输出<input type="text" name="username" value="国庆六十周年_1" id="tid">标签type属性的值
  
  alert(inputElement.type);
  
  </script>
</html>
</pre><pre name="code" class="html">


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

大家随意看一看就可以了

相关文章

IE6是一个非常老旧的网页浏览器,虽然现在很少人再使用它,但...
PHP中的count()函数是用来计算数组或容器中元素的个数。这个...
使用 AJAX(Asynchronous JavaScript and XML)技术可以在不...
Ajax(Asynchronous JavaScript and XML)是一种用于改进网页...
本文将介绍如何通过AJAX下载Excel文件流。通过AJAX,我们可以...
Ajax是一种用于客户端和服务器之间的异步通信技术。通过Ajax...