Is it possible to add placeholder in div tag

前端 未结 4 1256
南方客
南方客 2020-12-04 12:26

I would like to display some text to the user when my div element is empty.

I have tried adding a placeholder attribute to my div but the t

4条回答
  •  臣服心动
    2020-12-04 12:31

    Assuming what you really want to do is to have the user input some text and show him some placeholder in the input field, this is what you can use:

    
    

    Of course you can wrap the input in a div.

    You can see this in action here

提交回复
热议问题