use javascript set value to input ,the input value will disappear when it's on focus

Viewed 427

i have try to fill some value into input field by javascript(chrome extension)which belong to a form , the value seems not update, and will disappear when i click the other area of the page , my code is simple

document.getElementById("editGiftCardNumber").value = "12345";
document.getElementById("editGiftCardNumber").setAttribute('value','12345');

also try to use

 setTimeout(function() 

e.g. in https://www.elementaryrobotics.com/ , i try to set value in chrome console

input = document.getElementById("comp-jpua0zn5input");
input.value="123";

you will see the 123 is shown in input, if I click other area of the page, the 123 will disappear, how to solve it ?

0 Answers
Related