提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
前言
使用jquery获取表单数据,在控制台打印结果
一、jquery是什么?
jQuery是一个快速、简洁的JavaScript框架,是继Prototype之后又一个优秀的JavaScript代码库(框架)于2006年1月由John Resig发布。jQuery设计的宗旨是“write Less,Do More”,即倡导写更少的代码,做更多的事情。它封装JavaScript常用的功能代码,提供一种简便的JavaScript设计模式,优化HTML文档操作、事件处理、动画设计和Ajax交互。
二、代码构成
代码如下:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="js/jquery-3.6.0.js"></script>
<style>
body{
margin: 0px;
font-size:14px;
}
.top{
width: 100%;
height: 40px;
background-color: azure;
border:0px solid red;
position: relative;
}
.top span {
font-weight: bold;
float: left;
line-height: 40px;
margin-left: 7px;
}
.topul{
margin: 0px;
list-style: none;
}
.topul li{
float: left;
line-height: 40px;
margin-left: 5px;
margin-right: 3px;
}
.main{
margin: 10p