https://github.com/kshirish/javascript-garden
First few steps to learn javascript
https://github.com/kshirish/javascript-garden
Last synced: over 1 year ago
JSON representation
First few steps to learn javascript
- Host: GitHub
- URL: https://github.com/kshirish/javascript-garden
- Owner: kshirish
- Created: 2014-08-26T15:55:46.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2016-06-14T08:12:27.000Z (about 10 years ago)
- Last Synced: 2024-03-15T22:03:39.004Z (over 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 18.6 KB
- Stars: 3
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Javascript Garden
=================
This is just a bunch of snippets accumulated from here and there, that might help you improving basics.
1. https://bonsaiden.github.io/JavaScript-Garden/
2. https://developer.mozilla.org
3. Javascript - The Good Parts By Doglous Crockford
### e.stopPropagation() vs e.stopImmediatePropagation() vs e.preventDefault()
```html
press
```
```javascript
var kid = document.getElementsByTagName('button')[0];
var dad = document.getElementsByTagName('div')[0];
kid.addEventListener('click', function(e) {
console.log('kid here');
return false;
// e.preventDefault();
// e.stopPropagation();
// e.stopImmediatePropagation();
});
kid.addEventListener('click', function(e) {
console.log('neighbour kid here');
});
dad.addEventListener('click', function(e) {
console.log('dad here');
});
dad.addEventListener('click', function(e) {
console.log('neighbour dad here');
});
```
*Edit on fiddle here*: http://jsfiddle.net/7jquh3go/