使用jquery获取表单数据,在控制台打印结果

本文介绍如何利用jQuery从表单中获取数据,并在控制台展示这些数据。通过示例代码,展示了具体的实现步骤,有助于理解jQuery在前端数据操作中的应用。
摘要由CSDN通过智能技术生成
源码:
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>​​​​​​​
        <script src="jquery-3.6.0.min.js"></script>
        <script src="bootstrap.min.js"></script>
        <style type="text/css">
            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;/* 行间距40px*/
                margin-left: 7px;/* 设置左边间距为7px */                
            }
            .topul{
                margin: 0px;/* 取掉上下左右的间距 */
                list-style: none;/* 取掉ul的实心圆圈 */
            }
            .topul li{/* 给首页 --> 表单设置属性 */
                float: left;/* 向左浮动 */
                /* 行间距30px*/
                margin-left: 5px;/* 左边间距5px */
                margin-right: 3px;/* 右边间距5px */
            }
            .main{
                margin: 10px 18px;/* 上下为10px,左右18px */
            }
            .main_title{
                height: 30px;
                margin-top: 10px;
                margin-bottom: 20px;
                border-bottom: 1px solid gainsboro;/* 给"注册信息"设置下框线 */
                position: relative;
            }
            .main_title span{/* 给"注册信息"设置属性" */
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值