<input type="checkbox" />
<label>I agree</label>
Now when I click "I agree", nothing happens, I'd like to make the checkbox checked
, what's the easiest way to do this?
You must set an id for your checkbox, then refer it in the for attribute of the label. The id you use must be unique within your html document - basic but often missed!
Label widgets in Tkinter are used to display text and images. We can link a URL with the label widget to make it clickable. Whenever the label widget is clicked, it will open the attached link in the default browser.
Click on the exact place in the document where you want to insert a single checkbox. Click on the Insert menu and then on Symbol option. From the list of symbols find the checkbox symbol you want to insert and double click on it.
for
and id
attributes
<input id="thisinput" type="checkbox" />
<label for="thisinput">I agree</label>
http://jsfiddle.net/PNYNR/
As an alternative to what @stevether suggested, you can also wrap the label around the checkbox
<label><input type="checkbox" /> I agree</label>
http://jsfiddle.net/WDerc/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With