function validate() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
if (username == "") {
document.getElementById("message").innerHTML = "USERNAME CANNOT BE EMPTY";
document.getElementById("username").style.borderColor = "red";
return false;
}
if (password == "") {
document.getElementById("message").innerHTML = "PASSWORD CANNOT BE EMPTY";
document.getElementById("password").style.borderColor = "red";
return false;
}
}Run Code Online (Sandbox Code Playgroud)
#username:focus {
background-color: yellow;
border-color: green;
}
#password:focus {
background-color: yellow;
border-color: green;
}
#message {
color: red;
}Run Code Online (Sandbox Code Playgroud)
<form onsubmit=" return validate()">
LOGIN:-
<br>
<input id="username" type="text" name="username" placeholder="USERNAME">
<br>
<input id="password" type="password" …Run Code Online (Sandbox Code Playgroud)我在我的电脑上安装了Python。
当我输入python命令提示符时,我收到以下消息:
'python' is not recognized as an internal or external command,
operable program or batch file.
Run Code Online (Sandbox Code Playgroud)
但当我输入时,py它似乎起作用了,我得到以下信息:
Python 3.7.0 (v3.7.0, Jun 27 2018, 04:59:51) [MSC v.1914 64
bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license"
for more information.
Run Code Online (Sandbox Code Playgroud)
为什么会发生这种情况?
仅供参考:我检查了环境变量中的路径变量,但没有看到任何 python 安装路径。
python.exe那么可视化代码如何能够找到并运行Python代码的路径呢?
我很困惑。