Skip to content

Instantly share code, notes, and snippets.

@antronic
Forked from chaintng/pokedex-jquery-1.js
Created August 19, 2016 10:49
Show Gist options
  • Save antronic/e41533527e510b052b1a046fd83a5e49 to your computer and use it in GitHub Desktop.
Save antronic/e41533527e510b052b1a046fd83a5e49 to your computer and use it in GitHub Desktop.
pokedex-jquery-1
// 1. set Listener for each filter
$("#pokemonTypeFilter").on('change', function(){
var filterPokemonType = this.value;
var filterPokemonAtk = $("#pokemonAtkFilter").val();
var filterPokemon = filterPokemonByTypeAndMinAtk(allPokemons, filterPokemonType, filterPokemonAtk);
renderPokemonList(filterPokemon);
});
$("#pokemonAtkFilter").on('keyup', function(){
var filterPokemonAtk = this.value;
var filterPokemonType = $("#pokemonTypeFilter").val();
var filterPokemon = filterPokemonByTypeAndMinAtk(allPokemons, filterPokemonType, filterPokemonAtk);
renderPokemonList(filterPokemon);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment