获取元素值

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  </head>
<body>

	<input id="inputid" value="inputvalue">
	
	<script>
		$(function() {
			var val = $('#inputid').val();
			console.log('input value:' + val);
		});
	</script>
	
</body>
</html>

  

posted @ 2015-09-10 12:34  helloweworld  阅读(236)  评论(0编辑  收藏  举报