当前位置:网站首页>Role of JS No
Role of JS No
2022-07-03 03:38:00 【South wind ~ ancient grass】
1、# representative id Selectors
Such as $("#LUsername").val();( Get the corresponding id The value of the object )
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<div>
<label>
<span> user name </span>
<input type="text" id="LUsername" />
</label>
<label>
<span> password </span>
<input type="password" id="LPassword"/>
</label>
<button type="button" class="submit" id="login" onclick="return check();"> deng record </button>
</div>
</body>
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
<script>
function check(){
var username = $("#LUsername").val();/* Get id by LUsername Of input The value corresponding to the input box */
var password= $("#LPassword").val();/* Get id by LPassword Of input The value corresponding to the input box */
console.log(" user name :"+username)
console.log(" password :"+password)
}
$(function () {
document.onkeydown=keyDownSearch;
function keyDownSearch(e) {
var theEvent = e || window.event;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if(code==13){
$('#login').click();
return false;
}
return true;
}
})
</script>
</html>
In the above code , use js Completed the simple monitoring of the login button .
After clicking the login button , On the button onclick Going to call check() function , adopt id The selector takes the value of the object after it gets it .
Set the value in Console Console output .
边栏推荐
- The difference between static web pages and dynamic web pages & the difference between Web1.0 and Web2.0 & the difference between get and post
- redis高级应用【密码防护、数据持久化、主从同步、哨兵模式、事务】【暂未完成(半成品)】
- Bigvision code
- LVGL使用心得
- Section 26 detailed explanation and demonstration of IPSec virtual private network configuration experiment - simulation experiment based on packettracer8.0
- C# WebRequest POST模式 ,基于“Basic Auth”口令认证模式,使用multipart/form-data方式上传文件及提交其他数据
- Table structure of Navicat export database
- Stepping on pits and solutions when using inputfilter to limit EditText
- [algebraic structure] group (definition of group | basic properties of group | proof method of group | commutative group)
- Bid farewell to artificial mental retardation: Mengzi open source project team received RMB 100 million financing to help NLP develop
猜你喜欢
On the adjacency matrix and adjacency table of graph storage
渤、黄海的潮汐特征
Makefile demo
Elsevier latex 提交文章 pdftex.def Error: File `thumbnails/cas-email.jpeg‘ not found: using draf
没有sXid,suid&sgid将进入险境!-尚文网络xUP楠哥
Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence
Nce detail of softmax approximation
别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
MongoDB复制集【主从复制】
Stop using system Currenttimemillis() takes too long to count. It's too low. Stopwatch is easy to use!
随机推荐
Limit of one question per day
监听对象中值变化及访问
com. fasterxml. jackson. databind. Exc.invalidformatexception problem
[mathematical logic] propositional logic (propositional logic reasoning | formal structure of reasoning | inference law | additional law | simplification law | hypothetical reasoning | refusal | disju
[mathematical logic] normal form (conjunctive normal form | disjunctive normal form | major item | minor item | maximal item | minor item | principal conjunctive normal form | principal disjunctive no
编译文件时报错:错误: 编码GBK的不可映射字符
Application of derivative in daily question
释放数据力量的Ceph-尚文网络xUP楠哥
解决高并发下System.currentTimeMillis卡顿
leetcode:动态规划模板
MongoDB主配置文件
[set theory] partial order relation (partial order relation definition | partial order set definition | greater than or equal to relation | less than or equal to relation | integer division relation |
Download and install node, NPM and yarn
Pytorch轻量级可视化工具wandb(local)
[mathematical logic] propositions and connectives (propositions | propositional symbolization | truth connectives | no | conjunction | disjunction | non truth connectives | implication | equivalence)
Convert binary stream to byte array
[combinatorics] brief introduction to generating function (definition of generating function | Newton binomial coefficient | commonly used generating function | correlation with constant | correlation
Numpy warning visibledeprecationwarning: creating an ndarray from ragged needed sequences
Separable bonds and convertible bonds
递归:深度优先搜索