채택완료

버튼식으로 눌러야 실행되는것을 바로 실행되게 바꾸고 싶어요

2017-04-16 (일) 12:25:40 6,748

<div style="margin:0 auto; margin-top:100px; width:500px; text-align:center">

<form method="post">

게시판아이디: <input type="text" name="bo_table" value="1">

<input type="submit" value="auto">

</form>

버튼식으로 눌러야 실행되는것을 바로 실행되게 바꾸고 싶어요 

|

답변 2개 / 댓글 1개

채택된 답변
+20 포인트

<div style="margin:0 auto; margin-top:100px; width:500px; text-align:center">

<form id="frm" method="post">

게시판아이디: <input type="text" name="bo_table" value="1">

<input type="submit" value="auto">

</form>

<script>

$(function(){

$("#frm").submit();

});

</script>

이렇게 해보세요

답변에 대한 댓글 1개

2017-04-16 (일) 14:27:52
안되네요.. 버튼이 나오고 자동실행은 안되네요
2017-04-16 (일) 15:43:26

$(function() {

   $("input[type='submit']").trigger("click"); 

});

trigger() 사용하시면 돼요. 

답변을 작성하려면 로그인이 필요합니다.