jQuery/javascript - Input fields (user,pass) just like twitter's login?

后端 未结 6 702
萌比男神i
萌比男神i 2021-01-21 13:14

How can I achieve the same effect like twitter\'s log-in form (the top on the right) - when you click on the username/pass the value \"username\" stays there until you enter tex

6条回答
  •  猫巷女王i
    2021-01-21 13:50

    You could use the answer for Delete default value of an input text on click or if you fancy some HTML5 forms there is now native support for this functionality; it is called the placeholder-attribute.

    Twitter actually uses a '' inside a

    wrapper and JavaScript to achieve this affect.

    Username

提交回复
热议问题