Most of the questions now-a-days are slightly basic and mundane, but can have an extent of using different techniques or methods to do. One such question is JavaScript hide part of input text. Here, there are two methods but I took a wiser method and answered. I didn't think if this is some kind of low quality for sure. It was good.
I didn't want to make the OP not learn by giving away the code but gave a perfect guidance on how to arrive to the solution:
- Execute the following in the
blur
event.- Have a data attribute for the input with the original value.
- Change the value to have your desired display value.
- On
focus
, change back to the original value.
And I stopped the answer here. I am not sure if this is deemed a low quality answer! In my opinion, I am giving a guidance to the user and making them write the code, instead of providing a snippet and making them deprive of the learning ability.
Now I have posted the code, the downvotes stopped. What I reckon after this is, the user will just copy and paste the code, and they will not learn how to achieve the solution.
Guys, I attribute whatever I learnt till now to Stack Overflow, but this kind of behaviour - not only demotivates people answering but also deprives the user to learn!
My question to the community is, is my first revision of answer poor? Just curious. Really curious, where are we going?
:(
Can you update the question with a screenshot of deleted comments, if needed? Thanks BC.Execute the following
. The answer was incomplete and that's why I downvoted.:)