How do I change the value attribute value in the input tag?
It is necessary to change the value using Javascript
, because the search form is generated by itself and there is no access to the code.
Thank you very much in advance.
1
2 answers
Pure_js:
document.getElementById('someInputId').value = 'changed Value';
JQuery:
$('#someInputId').val('changed Value');
8
Author: knes, 2012-07-30 09:50:52
$(document).ready(function(){
$("input").val("Значение");
});
Или
<input onclick/onblur="this.value='Значения'">
It depends on what your situation is. Don't forget to connect the Jquery library.
0
Author: shanhaichik, 2012-07-31 19:19:24