当前位置:网站首页>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 .
边栏推荐
- PHP generates PDF tcpdf
- [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
- 900w+ data, from 17s to 300ms, how to operate
- 别再用 System.currentTimeMillis() 统计耗时了,太 Low,StopWatch 好用到爆!
- Download and install node, NPM and yarn
- Converts a timestamp to a time in the specified format
- [MySQL] the difference between left join, right join and join
- Introduction à mongodb
- [pyg] understand the messagepassing process, GCN demo details
- Ansible简介【暂未完成(半成品)】
猜你喜欢
![C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 03 operators and expressions](/img/4a/1df03d9f3315debb4c335260ed39f2.jpg)
C programming learning notes [edited by Mr. Tan Haoqiang] (Chapter III sequence programming) 03 operators and expressions

softmax的近似之NCE详解

node,npm以及yarn下载安装

The calculation of stripe, kernel and padding in CNN

ffmpeg录制屏幕和截屏

Small guide for rapid formation of manipulator (VIII): kinematic modeling (standard DH method)
![Mongodb replication set [master-slave replication]](/img/2c/8030548455f45fa252062dd90e7b8b.png)
Mongodb replication set [master-slave replication]

numpy之 警告VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences

Bid farewell to artificial mental retardation: Mengzi open source project team received RMB 100 million financing to help NLP develop

Pytorch轻量级可视化工具wandb(local)
随机推荐
js中#号的作用
For instruction, uploading pictures and display effect optimization of simple wechat applet development
Converts a timestamp to a time in the specified format
机械臂速成小指南(八):运动学建模(标准DH法)
softmax的近似之NCE详解
navicat 导出数据库的表结构
Section 26 detailed explanation and demonstration of IPSec virtual private network configuration experiment - simulation experiment based on packettracer8.0
Lvgl usage experience
Open Visual Studio 2010 hangs when opening a SQL file sql file
Limit of one question per day
MongoDB简介
[algebraic structure] group (definition of group | basic properties of group | proof method of group | commutative group)
[combinatorics] number of solutions of indefinite equations (number of combinations of multiple sets R | number of non negative integer solutions of indefinite equations | number of integer solutions
解决高並發下System.currentTimeMillis卡頓
On the adjacency matrix and adjacency table of graph storage
Change and access of median value of listening object
Mysql Mac版下载安装教程
[pyg] understand the messagepassing process, GCN demo details
Latest version of NPM: the "NPM" item cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Please check
The calculation of stripe, kernel and padding in CNN