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
adrien kovanic
5,727 Pointshow to extend a tickbox or checkbox to the text so that the text become clickable
Hi
So I decided to create a complete survey from scratch to train on html/ css / php mysql. right now I am working on the layout. 2 questions about that :
- what kind of type of tag do I need to use I thought of "form" with check boxes.
- I want the check box to be actually the text to select
ex : what fruit do you like? apple banana orange
I want the people to be able to click on the fruit directly.
thanks a lot !
PS : I would do that in CSS but cannot find how :/
1 Answer
Jesus Mendoza
23,289 PointsUsing for in your label will make it clickable and point to the id of the checkbox or input.
<label for="checkboxid">Hey</label>
<input type="checkbox" id="checkboxid" value="hey">