답변 4개
채택된 답변
+20 포인트
마르스컴퍼니
Expert
7년 전
참고 예제 코드입니다.
</p>
<p><input type="text" id="txt_num"> <button type="button" id="btn_go">이동</button></p>
<p> </p>
<p><script>
$(function() {
$('#btn_go').on('click', function() {
go_url = "<a href="<a href="http://seaferry.co.kr/" target="_blank" rel="noopener noreferrer">http://seaferry.co.kr/</a>" target="_blank"><a href="http://seaferry.co.kr/" target="_blank" rel="noopener noreferrer">http://seaferry.co.kr/</a></a>" + $(this).val() + ".php";
location.href = go_url;
});
});
</script></p>
<p>
로그인 후 평가할 수 있습니다
답변에 대한 댓글 4개
�
스타크루즈
7년 전
소스는 맞는거 같은데. 예제소스가 작동하지 않네요 ㅠ
�
마르스컴퍼니
7년 전
수정 코드입니다. $(this).val() -> $('#txt_num').val()
[code]
<input type="text" id="txt_num"> <button type="button" id="btn_go">이동</button>
<script>
$(function() {
$('#btn_go').on('click', function() {
go_url = "http://seaferry.co.kr/" + $('#txt_num').val() + ".php";
location.href = go_url;
});
});
</script>
[/code]
[code]
<input type="text" id="txt_num"> <button type="button" id="btn_go">이동</button>
<script>
$(function() {
$('#btn_go').on('click', function() {
go_url = "http://seaferry.co.kr/" + $('#txt_num').val() + ".php";
location.href = go_url;
});
});
</script>
[/code]
�
스타크루즈
7년 전
수정 코드도.. 안되네용.~~ ㅜㅜ
�
스타크루즈
7년 전
유후~ 잘 됩니다..^^ 감사합니다,
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인