두 번 이상 클릭 한 후 alert("hello")
함수가 생성되지 않는 이유를 이해하는 것이 놀랍습니다 ...이 함수를 실행하는 방법이 있습니까?jQuery html() 후 ID 선택기 사용 방법
html()
을 사용하여 업데이트 한 후에는 "누르십시오"라는 id가 필요합니다.
아이디어가 있으십니까? 참조 : http://jsbin.com/atuqu3
자바 스크립트 :
$(document).ready(function(){
$("#press").click(function() {
$("#relation-states").html('<select id="state" name="state"> <option value="Texas">Texas</option> </select><button id="press" type="button" title="" aria-haspopup="true" style="width: 175px;"><span>Select an item</span></button>');;
alert("hello");
});
});
HTML :
<div id="relation-states">
<select id="state" name="state">
<option value="New York">New York</option>
</select>
<button id="press" type="button" title="" aria-haspopup="true" style="width: 175px;"><span>Select an item</span></button>
</div>
감사합니다. 처음에는 한 번 더 클릭 한 후 "alert()"기능을 사용하려고했습니다 ... 내 어려움은 이것이었습니다. – Vegetus