저는 자바 스크립트와 jQuery를 처음 사용합니다. 드롭 다운 선택 상자를 구현하려고합니다. 특정 항목을 선택하면 입력 텍스트 상자가 비활성화됩니다.jQuery 코드를 자바 스크립트로 변환하기
<select name="Severity-of-your-symptoms" id="Severity-of-your-symptoms" class="cformselect" >
<option value="full01_severity_notselected" selected="selected">Please select...</option>
<option value="full01_severity_other">Mild</option>
<option value="full01_severity_other">Moderate</option>
<option value="Severe">Severe</option>
<option value="full01_severity_other">Other</option>
</select>
<br />
<input type="text" id="li-10-14" />
<input type="text" name="firstname" title="First Name" style="color:#888;"
value="First Name" onfocus="inputFocus(this)" onblur="inputBlur(this)" id='color'/>
<script type='text/javascript' src='http://code.jquery.com/jquery-1.4.2.js'></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.0/jquery-ui.js"></script>
<script type="text/javascript">
$('#Severity-of-your-symptoms').change(function() {
$("#li-10-14")[$(this).val() == "full01_severity_other" ? 'show' : 'hide']("fast");
}).change();
$('#Severity-of-your-symptoms').change(function() {
$("#li-10-14")[$(this).val() == "full01_severity_other" ? $('#color').attr("disabled", true)
: $('#color').attr("disabled", false)]
}).change();
</script>
난 정말 자바 스크립트에서이를 구현하고 싶어하지만 누군가가 나를 순수 자바 스크립트로이를 변환 할 수 있습니다, 그것은 jQuery를 함께 작업 얻을 수있었습니다 : 나는 다양한 유래 질문에서 함께 일부 jQuery를 해킹하여 구현 할 수 있었다 ?
왜? jQuery에서이 작업을 수행하지 않을 이유가 있습니까? –
jQuery _is_ Javascript. 너 무슨 짓을 한거야? 왜 jQuery를 좋아하니? – SLaks
의견 주셔서 감사합니다. 나는 jQuery가 자바 스크립트 라이브러리이고 자바 스크립트라는 것을 알고있다. 주로 jQuery 라이브러리없이 위의 코드를 작성하는 방법을 배우려는 학습 연습입니다. – user1152142