Home javascript How to change the value of the Value attribute in the Input...

How to change the value of the Value attribute in the Input tag?

Author

Date

Category

You need to change the value specifically using JavaScript , because The search form is generated by itself and there is no access to the code.

Thank you in advance.


Answer 1, Authority 100%

pure_js:

document.getelementbyid ('someinputid'). Value = 'Changed Value';

jQuery:

$ ('# SomeInputid'). Val ('Changed Value');

Answer 2

$ (document) .ready (function () {
 $ ("INPUT"). Val ("value");
});
Or
& lt; input onClick / Onblur = "this.value = 'values'" & gt;

It depends on what is your situation.
Do not forget to connect JQuery Library .

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions