Question and answer is powered by AnsPress.io
I have attached a placeholder text in my HTML div but div placeholder text not displaying. How can I display div placeholder text?
I am trying this code:
<div placeholder="My Code is here"> <p>my code</p> </div>
Try with this code:
<div contentEditable=true data-text="Enter text here"></div>
Apply it in the stylesheet:
[contentEditable=true]:empty:not(:focus):before{ content:attr(data-text) }