php - Facebook textarea functions -


i know how add function clears contents in textarea if typed. example, standard message in textarea say: "type something...", if typed, textarea cleared. basically, same function facebook uses in wallpost-textarea.

and how make height of textarea automatically follow amount of text, no scrollbar needed. again, same function facebook uses in wallpost-textarea.

actually, i've noticed function clears contents in textarea/input field used on site's signup page, when entering e-mail, password etc.

i hope of can me. i've tried find script without luck!

the first thing (html5) placeholder attribute. message there default , when start typing goes away.

http://www.w3.org/html/wg/drafts/html/master/forms.html#the-placeholder-attribute

for second 1 need javascript.

$('textarea').on('keyup',function(e){     $(this).css('height',$(this).get(0).scrollheight); }); 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -