我在登录页面使用Django的表单.I want to set focus to the first textField (username) when the page loads.
我尝试使用Jquery如下,但是没有得到结果.
forms.py: from django import forms class LoginForm(forms.Form): userName = forms.EmailField(max_length=25) password = forms.CharField( widget=forms.PasswordInput, label="password" )
的login.html
% block headextra %} {% endblock %} {% block content %}