검색 버튼 만들어서 버튼 클릭 하면 넘어가게 만들려고 하는데 도와 주세요 정보
검색 버튼 만들어서 버튼 클릭 하면 넘어가게 만들려고 하는데 도와 주세요
본문
아래 소스는 검색되면 자동으로 페이지로 넘어 가는데 검색 버튼 만들어서 버튼 클릭 하면 넘어가게 만들려고 하는데 도와 주세요
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script type="text/javascript">
<!--
function enterGo() {
var obj = document.getElementById('enterLink'); // 입력창 id
if(event.keyCode == '13') { // 엔터키 아스키 코드값
var keyword = obj.value; // 입력된 내용
if(keyword == '네이버') // 입력된 내용이 네이버 라면
location.href = 'http://www.naver.com'; // 네이버로 이동 합니다.
}
}
//-->
</script>
</head>
<body>
네이버라고 입력시에만 이동 합니다.
<input type="text" id="enterLink" onKeyUp="enterGo()">
</body>
</html>
추천
0
0
댓글 15개

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script type="text/javascript">
function ndSearch() {
var sValue = document.getElementById('searchline').value;
var nSearch = 'http://search.naver.com/search.naver?where=nexearch&query=';
window.open(nSearch+sValue,'');
}
</script>
</head>
<body>
<input type=text id=searchline>
<input type=button value="네이버 검색" onClick="ndSearch()">
</body>
</html>
참고가 되셨으면 하네요 ^^
이런 질문은 다음부터 질문게시판에서 하세요 ^^
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script type="text/javascript">
function ndSearch() {
var sValue = document.getElementById('searchline').value;
var nSearch = 'http://search.naver.com/search.naver?where=nexearch&query=';
window.open(nSearch+sValue,'');
}
</script>
</head>
<body>
<input type=text id=searchline>
<input type=button value="네이버 검색" onClick="ndSearch()">
</body>
</html>
참고가 되셨으면 하네요 ^^
이런 질문은 다음부터 질문게시판에서 하세요 ^^

주석처리 제거 다시올려요 제로보드에도 질문하신듯한데... ㅡㅡ;;

음....질문게시판으로 ㄱㄱ

^^

이렇게 말구요 제가 쓴 소스에
그냥 버튼만 추가해주세요 ,그러고 버튼 클릭 하면 넘어가게 네이버로 들어가서 검색 하는건 아니구요
그냥 버튼만 추가해주세요 ,그러고 버튼 클릭 하면 넘어가게 네이버로 들어가서 검색 하는건 아니구요

키워드 값 적용시 말씀 하시는군요 이해를 잘못 했네요

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script type="text/javascript">
<!--
function enterGo() {
var obj = document.getElementById('enterLink'); // 입력창 id
var keyword = obj.value; // 입력된 내용
if(keyword == '네이버') // 입력된 내용이 네이버 라면
location.href = 'http://www.naver.com'; // 네이버로 이동 합니다.
}
}
//-->
</script>
</head>
<body>
네이버라고 입력시에만 이동 합니다.
<form name='frm' onsubmit="return false;">
<input type='text' id="enterLink" onkeydown='if(event.keyCode == "13"){enterGo()};'><input type='button' onclick='enterGo();' value='검색'>
</form>
</body>
</html>
질문게시판 http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=252960
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script type="text/javascript">
<!--
function enterGo() {
var obj = document.getElementById('enterLink'); // 입력창 id
var keyword = obj.value; // 입력된 내용
if(keyword == '네이버') // 입력된 내용이 네이버 라면
location.href = 'http://www.naver.com'; // 네이버로 이동 합니다.
}
}
//-->
</script>
</head>
<body>
네이버라고 입력시에만 이동 합니다.
<form name='frm' onsubmit="return false;">
<input type='text' id="enterLink" onkeydown='if(event.keyCode == "13"){enterGo()};'><input type='button' onclick='enterGo();' value='검색'>
</form>
</body>
</html>
질문게시판 http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=252960

잘 됩니다 갑사합니다.

^^ 감사하긴요 자주 놀러오세요 자유게시판에도... ^^

새창에서 열게 할려면 어떻게 하나요 ?

위 코드중에
location.href = 'http://www.naver.com'; // 네이버로 이동 합니다.
대신 아래로 교체 해보세요
window.open('http://www.naver.com', '_blank');
location.href = 'http://www.naver.com'; // 네이버로 이동 합니다.
대신 아래로 교체 해보세요
window.open('http://www.naver.com', '_blank');

완벽합니다... ^.^

ㅎㅎㅎ ^^ 완벽하다 하시니 저또한 기쁩니다. 이만 퐁덩~

어 왜 신고가 안되었을까????
그누님들 참 착해요....ㅎㅎ
특히 쌈쟁이헌이님.....ㅋㅋ
그누님들 참 착해요....ㅎㅎ
특히 쌈쟁이헌이님.....ㅋㅋ

쌈쟁이가......착하다고 오해 하시면 아니 되옵니다 ^^