当前位置:网站首页>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 .
边栏推荐
- 二进制流转换成字节数组
- 编译文件时报错:错误: 编码GBK的不可映射字符
- Learning notes of C programming [compiled by Mr. Tan Haoqiang] (Chapter III sequence programming) 04 C sentence
- Captura下载安装及在Captura配置FFmpeg
- umi 路由拦截(简单粗暴)
- navicat 导出数据库的表结构
- 403 error displayed when vs cloning
- Separable bonds and convertible bonds
- [MySQL] the difference between left join, right join and join
- [mathematical logic] propositional logic (propositional and connective review | propositional formula | connective priority | truth table satisfiable contradiction tautology)
猜你喜欢

Limit of one question per day

Ffmpeg download and installation tutorial and introduction

softmax的近似之NCE详解

Section 26 detailed explanation and demonstration of IPSec virtual private network configuration experiment - simulation experiment based on packettracer8.0

On the adjacency matrix and adjacency table of graph storage

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

Docker install and start MySQL service

ffmpeg之 一张/多张图片合成视频

Pytorch multi card distributed training distributeddataparallel usage

Vs 2019 configuration tensorrt
随机推荐
Pytoch configuration
Introduction à mongodb
umi 路由拦截(简单粗暴)
【AI实战】应用xgboost.XGBRegressor搭建空气质量预测模型(一)
MongoDB主配置文件
Téléchargement et installation du client Filezilla
Converts a timestamp to a time in the specified format
Small guide for rapid formation of manipulator (VIII): kinematic modeling (standard DH method)
MongoDB简介
Recursive use and multi-dimensional array object to one-dimensional array object
[mathematical logic] propositional logic (propositional logic reasoning | formal structure of reasoning | inference law | additional law | simplification law | hypothetical reasoning | refusal | disju
Some preliminary preparations for QQ applet development: make an appointment for a development account, download and install developer tools, and create QQ applet
Applet get user avatar and nickname
Bigvision code
Captura下载安装及在Captura配置FFmpeg
动态规划:最长公共子串和最长公共子序列
ffmpeg下载安装教程及介绍
[mathematical logic] propositional logic (propositional and connective review | propositional formula | connective priority | truth table satisfiable contradiction tautology)
解决高并发下System.currentTimeMillis卡顿
[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