How can i achieve the same functionality as the placeholder of input inside a editable div element? [Solved] | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How can i achieve the same functionality as the placeholder of input inside a editable div element? [Solved]

So i am trying to have the same placeholder thing for div element just like input element? What should i do ? I have tried span thing but didn't worked at all ,tried making blob of placeholder text and using it as image but that doesn't works as well ,so what else can I do ? Ty in advance Edit: before psuedo selector did helped me achieve my goal easily https://code.sololearn.com/WYfqfFsuHfRz/?ref=app

25th Oct 2020, 9:56 AM
Abhay
Abhay - avatar
1 Answer
+ 1
I think you can just use it the same way as an input tag <div type="text" placeholder="Enter text">
5th Nov 2020, 1:33 PM
David Emmanuel
David Emmanuel - avatar