How to add placeholder <input type=“datetime-local”> field?

后端 未结 5 653
忘了有多久
忘了有多久 2021-01-21 06:36

I\'ve been trying to add placeholder in input type=\'datetime-local\' field but it doesn\'t work at all. Use css for solving the issue but still unable to do it :(

5条回答
  •  悲&欢浪女
    2021-01-21 06:55

    Sharath Daniel is on the right lines. A jQuery version: http://jsfiddle.net/2e97L3d0/1/

    HTML

    Javascript

    $(document).ready(function(){
    $("#datetime1").focus( function() {
        $(this).attr({type: 'datetime-local'});
      });
    

    });

提交回复
热议问题