[Demo][Add HTML+CSS+JQuery]


(1) 参考前一篇blog创建demo:

http://blog.csdn.net/hahahoho_xixi/article/details/50429727


(2) 增加前段页面(html, css, jquery)



目前项目框架:

Spring MVC

HTML+CSS+JQuery



Demo as follow:


(1) show home page on tomcat server


(2) show home page on IE explorer


(3) enter map page on IE explorer





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
HTML代码: ```html <!DOCTYPE html> <html> <head> <title>动态添加表格行数据</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <style> table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: 8px; border-bottom: 1px solid #ddd; } tr:hover { background-color: #f5f5f5; } th { background-color: #4CAF50; color: white; } </style> </head> <body> <h2>动态添加表格行数据</h2> <table id="myTable"> <thead> <tr> <th>产品</th> <th>金额</th> <th>名字</th> </tr> </thead> <tbody> <tr> <td>iPhone</td> <td>$999</td> <td>John Doe</td> </tr> <tr> <td>iPad</td> <td>$799</td> <td>Jane Doe</td> </tr> </tbody> </table> <br> <label for="product">产品:</label> <input type="text" id="product" name="product"> <label for="amount">金额:</label> <input type="text" id="amount" name="amount"> <label for="name">名字:</label> <input type="text" id="name" name="name"> <button id="addRow">添加行</button> <script src="main.js"></script> </body> </html> ``` JS代码: ```js $(document).ready(function() { $("#addRow").click(function() { var product = $("#product").val(); var amount = $("#amount").val(); var name = $("#name").val(); if (product == "" || amount == "" || name == "") { alert("请填写完整信息!"); return; } var newRow = "<tr><td>" + product + "</td><td>" + amount + "</td><td>" + name + "</td></tr>"; $("#myTable tbody").append(newRow); $("#product").val(""); $("#amount").val(""); $("#name").val(""); }); }); ``` CSS代码: ```css table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: 8px; border-bottom: 1px solid #ddd; } tr:hover { background-color: #f5f5f5; } th { background-color: #4CAF50; color: white; } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值