Or71nH 2020. 4. 16. 15:03
<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <a id="t1" href="./demo.html">opentutorials</a>
    <input id="t2" type="checkbox" checked="checked" />
    <script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
    <script>
    // 현재 문서의 URL이 아래와 같다고 했을 때
    // http://localhost/jQuery_attribute_api/demo2.html
    var t1 = $('#t1');
    console.log(t1.attr('href')); // ./demo.html
    console.log(t1.prop('href')); // http://localhost/jQuery_attribute_api/demo.html

    var t2 = $('#t2');
    console.log(t2.attr('checked')); // checked
    console.log(t2.prop('checked')); // true
    </script>

  </body>
</html>

체크박스 확인하기