获取输入内容,存储json格式


<html>
	<head>
		<meta charset="UTF-8">
		<title>title>
		<script type="text/javascript" src="js/jquery.js">script>
	head>
	<body>
		<input type="text" name="username" id="username"/>
		<input type="text" name="password" id="password"/>
		<button onclick="login();">submitbutton>
	body>
	<script>
		function login(){
			name = $("#username").val();
			pwd = $("#password").val();
			
			var options = {
				username:name,
				password:pwd
			}
			console.info(options)
		}
	script>
html>

{username: "b", password: "b"}
password:"b"
username:"b"
__proto__:Object

你可能感兴趣的:(js1)