役に立ちましたか?

質問


Let’s say the following is our input type with value, “John Smith” −

To change, use the attr() method −

$('#changeTheName').attr('value', 'Please enter your name.......');

You need to use the concept of attr(). Following is the code −

Example

 Live Demo






Document








To run the above program, save the file name “anyName.html(index.html)” and right click on the file. Select the option “Open with Live Server” in VS Code editor.

Output

This will produce the following output −

raja
Published on 10-Sep-2020 07:08:27

役に立ちましたか?
所属していません Tutorialspoint