Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts

Javascript - how to break or return value in forEach

Javascript has built-in function forEach

example

var tab = ['a', 'b', 'c'];

tab.forEach(function(el, i) {
  console.log(el, i);
});

Jquery - how to check what events are assigned to elements (.data)


If you use jquery events like below: 

 
<!doctype html>
<head>
<meta charset="utf-8"> 
<script src="./jquery-1.10.2.js"></script>

<script> 
 $(function() {
   $('#link').click(function(e) {
   console.log('klik jquery', e);
   return false;
  });
 });