+ 3
How can i Clean a value one by one in JavaScript?
Supposes i have "input type" value in Html "hello" and i get it's value to JavaScript and i want to clean hello on pressing Button but only one Alphabet be removed example <button onclick="myfun()">clean</button> hello 1.hell 2.hel 3.he 4.h null Explain it in simple way with a example.
7 Answers
+ 3
@Yasser button must be there and actually i want to make a programming in which if i click the button
it would remove one Alphabet like "hello"
if i click the button the result should be "hell" if i click once more the result should be "hel" and like this it would run till the word become null.
i hop you get it.
+ 3
first of all thanks a lotš
its all because of you
i will be able to complete
my project.
+ 2
@Yasser you made it but just a little more change has to be done can you clean only the letter's present into the "input id" box . See i want to make a button which work like as in phone when we write something wrong on click the button it cleans one by one Alphabet's .
+ 2
O yes @Yasser
Brilliant man
and thats i want.
+ 2
what is the work of "use strict" value which you given on the function.
+ 2
myInput.value = myInput.value.slice(0, -1);
"can you explain me little this please."
+ 2
By the way @Yasser
i can understand you
and your comments
nicely š .