다음 코드에서 jQuery 함수를 두 번 호출했지만 처음에는 작동하는 것 같습니다.두 번째 호출 JQuery 스크립트가 실패합니다.
<p>Depature date:
<input type="text" id="datepicker" />
</p>
다음 부분은 입력 텍스트 상자를 생산하지만, 일정 옵션 [이 스크립트를 호출하지 않습니다를 열 수있는 이미지 링크가 없습니다 :
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Datepicker - Icon trigger</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"
/>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$("#datepicker").datepicker({
showOn: "button",
buttonImage: "images/calendar.gif",
buttonImageOnly: true
});
});
</script>
</head>
<body>
다음 부분은 완벽하게 작동 ] :
<p>Depature date:
<input type="text" id="datepicker" />
</p>**
</body>
</html>
모든 제안 사항은 대단히 감사하겠습니다. 나는 이것이 단지 보일 수없는 단순한 대답을 가지고 있다고 느낀다.
감사
여러 요소는 다음 클래스 속성을<p>Depature date: <input type="text" class="datepicker" />
</p>
<p>Depature date: <input type="text" class="datepicker" />
</p>**
를 사용하는 경우
정말 고마워요, 이것이 완벽한 답변이었습니다. 'id'를 클래스로 변경하는 것 외에도 '#datepicker'를 '.datepicker'로 변경해야했습니다. 감사합니다. –