Adding content from a Div into an input text field
Topics related to client-side programming language.
Post questions and answers about JavaScript, Ajax, or jQuery codes and scripts.
-
JanMolendijk
- Posts:282
- Location:Holland Rotterdam
Adding content from a Div into an input text field
I still don`t understand how I can get the results from a div into a text input form field ?
I want to place the result from #div2 into this type text:
Code: Select all
<input type="text" name="comment_content" rows="10" cols="50" id="comment_content" class="form-control" placeholder="Enter Comment" value="">
MarPlo
Posts:186
To add content from a Div into an input field, for example when a button is pressed, you can use this JavaScript code:
Code: Select all
var div2 = document.getElementById('div2');
var comment_content = document.getElementById('comment_content');
var btn_add = document.getElementById('id_btn');
btn_add.addEventListener('click', (ev)=>{
comment_content.value = div2.innerHTML;
});
JanMolendijk
Posts:282
Thanks Chief for all your support....
My URL-extractor is working
in the comment-system
Similar Topics
- Speech to text without https
General Forum
First post
Pleasant Coursesweb,
Is their anything posible without https for speech to text fill-in ?
Or must I turn my SSL document on the XAMPP-server ?
Last post
Hello,
I don't know about speech to text fill-in.
Anyway, I want to inform you that this forum will be closed for register or posting.
Any...