+ 1
How to edit input by user
See my code i want to edit the name https://code.sololearn.com/WmPskAtOm78M/?ref=app
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+"!")
+ 1
No
The Word that user entered, i want to edit it
+ 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
+ 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. ~~~~
+ 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