Adding placeholder attribute using Jquery

后端 未结 4 1605
面向向阳花
面向向阳花 2021-02-05 05:37

I have a simple problem. I just want to add a placeholder on an input. Here\'s the code:

HTML:


JQuery         


        
4条回答
  •  清歌不尽
    2021-02-05 06:14

    you just need to put this

    ($('#{{ form.email.id_for_label }}').attr("placeholder","Work email address"));

    ($('#{{ form.password1.id_for_label }}').attr("placeholder","Password"));

提交回复
热议问题