使用jquery的change事件操作的事件处理

$(document).ready(function(){
		$("#infoSelect").change(function(){
				if($(this).find("option:selected").text() != "お選びください"){
				$("input[name='infoName'][type='text']").removeAttr("disabled");
				}
				if($(this).find("option:selected").text() == "お選びください"){
					$("input[name='infoName'][type='text']").attr("disabled",true);
				}
		})
	});


小小代码花了我4小时,遇到一些问题,主要集中在jquery的写法上

1,$("input[name='infoName'][type='text']")  //[name='infoName'][type='text']之间不能有空格

你可能感兴趣的:(jquery)