Can I specify maxlength in css?

前端 未结 8 415
情歌与酒
情歌与酒 2020-12-03 16:45

Can I replace the maxlength attribute with something in CSS?


8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-03 17:20

    You can use jQuery like:

    $("input").attr("maxlength", 4)
    

    Here is a demo: http://jsfiddle.net/TmsXG/13/

提交回复
热议问题