Skip to content

Instantly share code, notes, and snippets.

@chaintng
Last active August 19, 2016 10:49
Show Gist options
  • Save chaintng/9f16104d4f700158781dbb708d7e4c00 to your computer and use it in GitHub Desktop.
Save chaintng/9f16104d4f700158781dbb708d7e4c00 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