Top

ũ ̵ | Web-Programing
(admin) | Editor | 2016/04/14 18:11:20 | ȸ:9302

ũ Ŭ ̵ .



- HTML -

  1. <div class="nolink">
  2. <a href="http://google.com" target="_blank">google</a>
  3. <a href="javascript:location.href='http://naver.com'" target="_blank">google2</a>
  4. <a href="javascript:;" onclick="location.href='http://naver.com'" target="_blank">google3</a>
  5. <button onclick="location.href='http://naver.com'">naver</button>
  6. </div>


- JS -

  1. jQuery(function($){
  2.     var $preview_zone = $('.nolink');
  3.     var msg = 'alert message';
  4.     $preview_zone
  5.       .find('a, [onclick]').on('click', function(){
  6.         alert(msg);
  7.         return false;
  8.       })
  9.       .prop('onclick', null);
  10.     ;
  11. });



 attr prop ѵ ٸ.

 attr Ӽ ڿ "checked" , prop Ӽ Boolean true, false  Ѵ.

  1. // Correct if changing the attribute is desired
  2. $(elem).attr("checked", "checked");
  3. // Correct for checking the checkbox
  4. $(elem).prop("checked", true);
  5. // Correct if removing the attribute is desired
  6. $(elem).removeAttr("checked");
  7. // Correct for clearing the checkbox
  8. $(elem).prop("checked", false);
ϱ
ϱ
0
0
0


ҷ Դϴ.
[PHP] 迭 ¸ Ϸ ֱ (admin) 2016-04-21 11:18:15
[javascript] document.documentMode (admin) 2015-10-28 13:58:57