main.ejs 1.82 KB
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title><%= title %></title>
    <link rel="icon" href = "FindMelogo.png">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css">
    <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
    <style> @import url("http://fonts.googleapis.com/earlyaccess/nanumgothic.css");</style>
    <script>
    $(document).ready(function(){


      $("button#searchButton").click(function(){
        var name = $("input").val();
        const checkbox = document.getElementById('tft_check');

        // 2. checked 속성을 체크합니다.
        const is_checked = checkbox.checked;
        console.log("-------------------------------")
        console.log(is_checked)
        if(is_checked==1){
          location.href = "http://localhost:3000/tft/search/" + name;

        } else {
          location.href = "http://localhost:3000/search/" + name;

        }
        
        
      })
    });
    </script>
  </head>
  <body>
    <div class="imgOpacity">
    <div class="center">
      <img src= "FindMelogo.png" width = 300, height = 300/>
    </div>
    <div class="center2">
      <div>
        <input type="text" class="input_text" placeholder="소환사 이름">
        <input type="checkbox" id="tft_check" name="tft_check" checked>
        <label for="tft_check">TFT</label>
      </div>
   	
    <span class="input-group-btn">
      <button id="searchButton" class="btn btn-primary" type="button" onclick="search(name)">click!</button>
    </span>
   </div>
  </div>
</body>
</html>