How to edit input by user | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to edit input by user

See my code i want to edit the name https://code.sololearn.com/WmPskAtOm78M/?ref=app

5th Nov 2018, 3:50 AM
Adnan Ansari
Adnan Ansari - avatar
5 Answers
+ 3
From 'Name' to what? you can add or act on the variable holding the string like below. var name=prompt("type your name") document.write("Hi, "+name+"!")
5th Nov 2018, 4:50 AM
Lord Krishna
Lord Krishna - avatar
+ 1
No The Word that user entered, i want to edit it
5th Nov 2018, 5:39 AM
Adnan Ansari
Adnan Ansari - avatar
+ 1
Adnan Ansari , To edit the users input just add a textarea tag to the javascript dom manipulation.(Just what Lord Krishna did but then adding textarea tags.) function edit(){ val=document.getElementById("input").value; doc=document.getElementById("output"); doc.innerHTML=("<textarea>"+val+"</textarea>"); } If you want to edit user input like Word, then you need to look up for a library that does support that. There are many out there. Here is the code snippet, hope it helps👍 https://code.sololearn.com/WD021xYn0egR/?ref=app
5th Nov 2018, 11:32 PM
🌴Vincent Berger🌴
🌴Vincent Berger🌴 - avatar
+ 1
Thats cool but still my question is not completed, ~~~I want to edit the input word that enter by the user like (color,size,font-family, animation )etc. ~~~~
6th Nov 2018, 5:38 PM
Adnan Ansari
Adnan Ansari - avatar
+ 1
Adnan Ansari, This is not your original post question... Please read this post and comments, it should improve your future question you asking in the Q&A section:: https://www.sololearn.com/discuss/1316935/?ref=app I made some changes to the code. Now you can increase, decrease & change color of the input value from the user. Have a look and I hope it helps👍 https://code.sololearn.com/WD021xYn0egR/?ref=app
6th Nov 2018, 6:23 PM
🌴Vincent Berger🌴
🌴Vincent Berger🌴 - avatar