2011/08/25

iPhoneでlabel forが使えないのをjQueる

何でlabel for使えないんですかね、この子は。
しかもラジオボタンもチェックボックスも微妙にちっこくないすか?
押しづれー!!
jQueryでごにょごにょしますよ。

$(function(){
	$('label').click(function(e){
		var elm=$('#'+$(this).attr('for'));
		if(elm.attr('checked')=='checked'){
			elm.removeAttr('checked');
		}else{
			elm.attr('checked','checked')
		}
		return false;
	});
	$(':checkbox,:radio').click(function(e){
		e.stopPropagation();
	});
});

カテゴリー: HTML5, jQuery — 12:05:44

トラックバック URL :

コメントはまだありません »

ページTOPへ