~ overflow ~

Archive for September 27th, 2010

label for=”id” don’t work on IE

by z3n on Sep.27, 2010, under Coding, Tips & Hints

Problem:

<input type='radio' value='x' id='something_1' name='something'>
<label for='something_1'>cool label</label>

When user clicks on the label radio should be selected, this only happens on firefox.

Solution:

$("label").click(function(){
	if ($(this).attr("for") != "")
		$("#" + $(this).attr("for")).click();
});

More info on this issue:

Stackoverflow posting

Leave a Comment :, , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!