вставить текст в форму
как вставить текст в эту форму на js?
<input type="password" maxlength="20" name="signup_password" value="" class="input_text"/> |
var div = document.createElement("div"); div.innerHTML = '<input type="password" maxlength="20" name="signup_password" value="" class="input_text"/>'; var input = div.removeChild(div.firstChild); div = null; form.appendChild(input); input = null; |
document.getElementsByName("signup_password")[0].value="Ваш текст"; P. S. nikita.mmf, боже, зачем такие сложности? |
у trikadin всё верно, никаких костылей не требуется
<input type="password" maxlength="20" name="signup_password" value="" class="input_text"/> <script> var input = document.getElementsByName("signup_password")[0]; input.value = "123456"; setTimeout( function(x){alert(x)},50,input.value) </script> |
Часовой пояс GMT +3, время: 05:17. |