Как заменить код
Всем доброго времени суток помогите пожалуйста с кодом javascript
Нужно мне поменять с помощью скрипта данную строку <textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none; display: none; "></textarea> заменить на эту <textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none; "></textarea> как сделать не пойму помогите!!!!! |
Именно строку, или таки элемент?
Если строку: text.replace( '<textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none; display: none; "></textarea>', '<textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid #c1c1c1; margin: 10px 25px; padding: 0px; resize: none; "></textarea>' );Логично, неправда-ли? Если всё же нужен элемент на странице, то: document.getElementById('g-recaptcha-response').style.removeProperty('display'); |
Aetae,
Спасибо огромное document.getElementById('g-recaptcha-response').style.removeProperty('display'); Подошло супер |
Часовой пояс GMT +3, время: 07:39. |