Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
marsha grasett
9,995 PointsAuto-hiding placeholder text
I was having a problem auto-hiding placeholder text in Firefox.
Came across this: http://jsfiddle.net/alicetheblue/Yy48L/
So now the text disappears when clicked.
Haven't tested on IE or PC - but that's another can of worms ;)
5 Answers
James Barnett
39,199 Points@Marsha - Browser support is IE10, and recent versions of Firefox, Opera & Safari.
You can get more details on placeholder browser support, over on Can I Use
marsha grasett
9,995 Points<input type="text" placeholder="enter your text" onfocus="this.placeholder = ''" onblur="this.placeholder = 'enter your text'" />
James Barnett
39,199 PointsI think placeholders don't go away until the user starts typing are preferable from a UX perspective.
James Barnett
39,199 PointsThat's a seriously neat trick, I didn't know that there were event attributes using HTML, it's like a whole new world.
J.T. Gralka
20,126 PointsYeah! I'm fairly certain that it's been possible to add event attributes to tags since HTML 4. It's kind of a nifty work around, don't you think?