How to change the wording of html submit button

藏色散人
Release: 2023-01-03 09:31:25
Original
5342 people have browsed it

How to change the wording of the html submit button: 1. Directly modify the value attribute, with code such as "onclick="getPasswd()" value="display "..."; 2. Modify the innerHTML of the button, with code such as "type="button" onclick...".

How to change the wording of html submit button

The operating environment of this article: Windows 7 system, HTML5 version, Dell G3 computer.

Modify the text displayed by button in html

1. Implement password input box Visible and hidden

##You can directly modify the value attribute

<script type="text/javascript">
function getPasswd(){    
var passwd = document.getElementById("pwdID");    
var pwdBtn = document.getElementById("pwdBtnID");    
if(passwd.type=="password")    {
        passwd.type="text";
        pwdBtn.value="隐藏";
    }    else{
        passwd.type="password";
        pwdBtn.value="显示";
    }
}</script>
密码:<input id="pwdID" type="password"><input id="pwdBtnID" type="button" onclick="getPasswd()" value="显示">
Copy after login

2.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!