Это видео недоступно.
Сожалеем об этом.

JavaScript Search Bar

Поделиться
HTML-код
  • Опубликовано: 14 авг 2024
  • Learn how to build a search bar with filter functionality in JavaScript.
    starter code - codepen.io/jam...
    finished code - codepen.io/jam...
    Harry Potter API - hp-api.herokuap...
    James Q Quick - www.jamesqquic...
    Learn Build Teach - www.learnbuild...
    Want to learn everything you need to know about Visual Studio Code? Check out Learn Visual Studio Code!
    Coupon - www.udemy.com/...
    Build a Quiz App with HTML, CSS, and JavaScript - www.udemy.com/...
    Facebook - / jamesqquick
    Twitter - / jamesqquick
    Instagram - / jamesqquick

Комментарии • 203

  • @novaria
    @novaria 3 года назад +44

    omg thank you so much! This was exactly what I was looking for. No need for bloated frameworks, overly-complicated dependencies with npm etc. And the code is super beautiful too.

    • @lookupverazhou8599
      @lookupverazhou8599 Год назад

      Everything can be done with vanilla, and more robustly, too.

  • @krisashehi5144
    @krisashehi5144 2 года назад +15

    One of the best tutorials I’ve ever come across. Super easy to understand, and the code looks super tidy.

    • @JamesQQuick
      @JamesQQuick  2 года назад +3

      Ahhh so good to hear that!

  • @amberw0704
    @amberw0704 2 года назад +1

    Bless up! 🙏 been struggling with a search function for two weeks and this just made it so simple and you were great at explaining it - not just running through everything super fast and confusing!

  • @Aditya_Kumar_12_pass
    @Aditya_Kumar_12_pass Год назад +1

    awesome. I was struggling to do this thing in react / next, took some time and worked !!

  • @iwatchtoomuchhaikyuu5307
    @iwatchtoomuchhaikyuu5307 2 года назад +2

    easily one of the best tutorial videos Ive seen, everything simplified and explained clearly and well. !!! just subscribed

  • @rishiprasath
    @rishiprasath 2 года назад +1

    Great! Now I can create an offline search with filtering. Good enough for working on a project without a database!

  • @TrashyyChan
    @TrashyyChan 2 года назад

    you just saved me from failing a class!! This was legit my whole semester work and i struggled so hard with the fecthing of the data from a json file (not even the searchbar but that helped too!)
    Thanks man for not just showing the searchbar but also the full process!!

  • @derickmoncado
    @derickmoncado Год назад +1

    I like this one more then Kyle's from WebDevSimplifeid, no offense to Kyle though! You're both legends, thank you both!

    • @JamesQQuick
      @JamesQQuick  Год назад +1

      bahaha I'll make sure to let him know!

  • @mateinegrescu8573
    @mateinegrescu8573 2 года назад +3

    Thank you, this was very instructive! I am also wondering how I could use checkbox filters on top of the search filter. For instance limit the search to just members of the Slytherin house by having and checking a Slytherin checkbox.

  • @zaurhasanov5458
    @zaurhasanov5458 Год назад

    Thank you! I was really struggling with this functionality and other tutorials didn't really help

  • @Jun-zq3bn
    @Jun-zq3bn 3 года назад +1

    works wonders, and had much fun plugging this into my backend database. thanks alot!

  • @codedynamics1
    @codedynamics1 3 года назад

    i had to just grab the input value using querySelector and it worked. Great video!! Simple to understand. Thank you!

  • @mattmjlg5053
    @mattmjlg5053 2 года назад

    Dude I cannot believe you would do something like this this is unbelievable I’m so proud of that guys like you are so smart and can figure out that this would help us out so much I am trying to start my own start up company but I can help with searching things up for my program and I’m very new so it’s not easy thank you so

  • @abdessadekelaasri8862
    @abdessadekelaasri8862 2 года назад

    You're the best teacher in RUclips, thanks so much

  • @smjonas8616
    @smjonas8616 2 года назад

    Thank you so much for this video! I am glad to hear that I don't need to learn a new Javascript framework for a simple search UI... It's sad that this basic stuff is so hard to find.

  • @musadanjuma6603
    @musadanjuma6603 4 года назад +3

    Great Tutorial James!!! looking forward to implementing this to the next app I'm developing... Thank you soooo much :)))

  • @georgelopez9356
    @georgelopez9356 3 года назад +2

    Great video, very clean and easy to undestand code. Great Job!!!

  • @rebequini
    @rebequini 2 года назад

    This is exactly what i needed for my project for this week hahha! seriously thank you so much !!!!!!! :)

  • @jesusdmmful
    @jesusdmmful 3 года назад +1

    James, i have a question, how can i do that search bar but using rick and morty api? i´m trying to do, but i have an error: array.filter is not a function :C . you are amazing!!. nice video

  • @daniaburiachenko7713
    @daniaburiachenko7713 2 года назад

    wow! thx u so much :) the best tutorial video on RUclips Ive seen!!!

  • @doesitstill
    @doesitstill 3 года назад

    Cheers, leveraged this tutorial to make a simple app using WordPress and the rest API

  • @jenshattas
    @jenshattas 2 года назад

    how can you make sure that for example if there where 2 harry potters but you needed only 1 it doesn't show doubles?

  • @Dare_to_face_Ted
    @Dare_to_face_Ted 2 года назад

    hey james thank you for the tutorial i'm just want to ask you i want to change the names and when it clicked on one of them it will take to another page can you help me pls ??

  • @tonyy.9855
    @tonyy.9855 Год назад

    this tutorial is so good.

  • @az1nn
    @az1nn 3 года назад

    Thanks for this video man! Greetings from Brazil!

  • @om7334
    @om7334 2 года назад

    Wonderful tutorial, subscribed!

  • @Robert723
    @Robert723 3 года назад +1

    Great tutorial!

  • @packagedstudios
    @packagedstudios 3 года назад +1

    Thanks so much for explaining it so clearly :D

  • @storyPlus12
    @storyPlus12 2 года назад

    Thank you so much brother 🙏

  • @freestyleerimasbr2851
    @freestyleerimasbr2851 4 года назад +2

    Thank you very much James! I am having a workshop at my school, and I was wondering if you could help on how to change the json file of harry potter characters to another json file and make the searching work, I am trying but without success!! Great video by the way!

    • @sarachachilina
      @sarachachilina 3 года назад

      @@i-am-oi how did you change the Json file?

  • @markreeves5561
    @markreeves5561 4 года назад +1

    Thanks very much for this tutorial. I have learned a lot from this tutorial. Thanks

    • @JamesQQuick
      @JamesQQuick  4 года назад

      Glad to hear it!

    • @user-ri2ms2mm7w
      @user-ri2ms2mm7w 2 года назад

      My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
      ruclips.net/p/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-

  • @charlest3788
    @charlest3788 4 года назад

    I like your sense of humour. Nice tutorial man!

  • @protopan7722
    @protopan7722 Год назад

    thank you so much this video is very good

  • @ajaydev7866
    @ajaydev7866 3 года назад

    thx for your video ! question : i have 2 search bar 1 for desktop view and another for tab view how to impliment in both
    ?

  • @unknownuser8276
    @unknownuser8276 2 года назад

    Hi, May I know how to change the harry potter characters into other characters from other movies? Like changing the harry potter characters into avengers characters

  • @rosacabrera4733
    @rosacabrera4733 2 года назад

    This was amazing! It worked like a charm. Thank you so much!!!

    • @Dare_to_face_Ted
      @Dare_to_face_Ted 2 года назад

      can i ask you pls i want to change the names so how i can do that ?

  • @gonzalobarg3460
    @gonzalobarg3460 3 года назад

    Great tutorial, very well explained!

  • @roycrave2420
    @roycrave2420 3 года назад

    harry potter functions in javascript! love it!

  • @Shujaathullakhan
    @Shujaathullakhan 2 года назад

    how do i dynamically refresh my html with the final filtered array, iam dsplaying my index from database pls help

  • @denisradovanovic8778
    @denisradovanovic8778 Год назад

    Hi James, would you mind sharing how can we use multiple words in a search to filter out, say for example: Diggory Snape? Thanks for great video.

  • @keeprunning5457
    @keeprunning5457 Год назад

    nice man gracias otra vez!

  • @kamertonaudiophileplayer847
    @kamertonaudiophileplayer847 2 года назад

    Interesting, it looks like you are a little old school comparing to the " Web Dev Simplified", but anyway, it is a great guide.

  • @tomcoop9750
    @tomcoop9750 2 года назад

    Awesome video 👍

  • @InvictusGamingOfficial
    @InvictusGamingOfficial 2 года назад

    I Need A Help!!!
    Please Tell Me How To Make Our Own API of Our Database Like Harry Potter API...

  • @sinnyozzy
    @sinnyozzy 2 года назад

    Thank you!

  • @cafeleche
    @cafeleche 2 года назад

    Really enjoyed it!!

  • @anthonysetiadi
    @anthonysetiadi 3 года назад

    This was great! Quick question, how would add functionality if you inserted a 'space' in your search query? Ie. search full name: Harry Potter

  • @thienay3899
    @thienay3899 3 года назад

    tks alot for this helpful tutorial.

  • @muhammadumarsotvoldiev8768
    @muhammadumarsotvoldiev8768 7 месяцев назад

    Thank you very much

  • @ahmad_mido
    @ahmad_mido Год назад +1

    it says "failed to fetch".. how to solve it please?

  • @Goldn_valouz
    @Goldn_valouz 3 года назад

    Thanks a lot I hope i'll get my internship with this searchBar. I've learned a lot

  • @hoanchaukhai7942
    @hoanchaukhai7942 2 года назад

    thanks you so much!!! this very useful to me hope u release more video like this

  • @ElSpoon
    @ElSpoon 2 года назад

    Is there a way to have the unfiltered list hidden, then shown once it starts filtering? That’s what I’m looking for but can’t find a solution anywhere

  • @Domuh
    @Domuh 3 года назад +1

    Hello, I was wondering if it is possible to also search by Number? I am doing the Pokedex you did and am implementing this Search Bar, however I can't seem to search for the IDs and Names because of the .Lowercase()

    • @JamesQQuick
      @JamesQQuick  3 года назад +1

      You could certainly query by number if you want. Maybe you could have two different inputs, one being a number?

    • @Domuh
      @Domuh 3 года назад +1

      @@JamesQQuick Thanks. Rather than doing pokeman.id.includes(), I did pokeman.id == searchTarget

  • @EDW4RD249
    @EDW4RD249 3 года назад

    Sr. Thank you!

  • @adnanrruka5152
    @adnanrruka5152 3 года назад

    Thank you

  • @DeniTosh
    @DeniTosh 3 года назад

    How would you access it if it was wrapped in an object? For example { - char:[the api]}.

  • @flavienmayet-webdev7392
    @flavienmayet-webdev7392 Год назад

    Character.map() doesn't work for me. It display map() is not function. How resolve problem ?

  • @AP-gc5ss
    @AP-gc5ss 3 года назад

    Thanks for teaching!

  • @LucasGenolet
    @LucasGenolet 2 года назад

    Excellent, thanks a lot!!

  • @nemethricsi
    @nemethricsi 2 года назад

    What font are you using, Master? 😍

  • @ruchirshrikhande5584
    @ruchirshrikhande5584 Год назад

    Hey,does anyone know how to fetch data from mongodb in client side instead of using a url in fetch?

  • @muhammadwadeed8967
    @muhammadwadeed8967 4 года назад +2

    I want to know that how to create data in this link on herokuapp. hp-api.herokuapp.com/api/characters

  • @pushpraj853
    @pushpraj853 Год назад

    why am I getting empty array when trying to console.log(hpCharacters) outside the async function

    • @JamesQQuick
      @JamesQQuick  Год назад

      Hard to tell without code. I have a Discord where you can ask questions and share code. learnbuildteach.com/

  • @enderbasser
    @enderbasser 2 года назад

    this was great tutorial, i wonder if you colud help me, i got it to work but i would like it to let me look whit 2 words. i mean, what if instead of looking for "HARRY", i want to look for "HARRY POTTER" to give you some context: what if i wanted to look in an ecommerce for "white fridge"
    i ask this because even when i got it to work whenever i put the "space" or (" ") it doesnt return any object. i am not an english native speaking so i hope you understand thanks

  • @84PatSch
    @84PatSch 3 года назад

    thank you very much, it was very helpful

  • @Peywan
    @Peywan 2 года назад

    but how do I make these work on a page I have done?

  • @vujadinovicc
    @vujadinovicc 2 года назад

    hello bro, can this javascript be used for any website or only for this one,

  • @untildawn5714
    @untildawn5714 3 года назад

    The man! Thanks!

  • @MichielvanderGragt
    @MichielvanderGragt 2 года назад

    Hi James, great tutorial. I am fairly new to JS and have a quick question about how you use the map method() to fill the string literals. Can I generate the outcome of another function inside a string literal? For example a list I generated somewhere else? Thanks! Michiel from Sweden

  • @JehadiHellTransportAgency
    @JehadiHellTransportAgency Год назад

    THANKYOU

  • @CoderDmitri
    @CoderDmitri 3 года назад

    ty so much. You are a Star!

  • @valeriacerpasalas2330
    @valeriacerpasalas2330 2 года назад

    Amazing code ♥ I love it, I would like to edit the json, do you know if it is possible? I see there are some characters that do not have a photo. I would like to add one. Could it be possible? Thanks

  • @settahkader
    @settahkader 4 года назад

    thanks for the tutorial, its very helpful

  • @TheRuttekut
    @TheRuttekut 3 года назад

    Great video thanks!

  • @user-hk6ns2eg1w
    @user-hk6ns2eg1w 4 года назад

    Thanks you so much for this video!

  • @nikolaWd
    @nikolaWd 2 года назад

    Can I do this in Java Web App?

  • @mohamedyahya7463
    @mohamedyahya7463 Год назад

    good job thnx

  • @ktkkoko4331
    @ktkkoko4331 3 года назад

    Very good sir I like it

  • @anythingfx8950
    @anythingfx8950 3 года назад

    Any idea how could i implement BACKSPACE? if i type too many letters and press backspace to erase wrong ones it shows that? because it is missing feature for me :) other than that very nice tutorial :)

  • @raba650
    @raba650 3 года назад

    How can I search with a button onclick instead of the onchange from the input?

  • @alanawinarta9887
    @alanawinarta9887 3 года назад

    Thanks a lot!

  • @sabuein
    @sabuein 3 года назад

    Thank you ☺️

  • @nolose6542
    @nolose6542 3 года назад

    thanks you so much !!!!

  • @zachfenton608
    @zachfenton608 2 года назад

    loved it a lot, would like to know how it can search through html or pictures that I have in an array or by event that i have i as cards

    • @user-ri2ms2mm7w
      @user-ri2ms2mm7w 2 года назад

      My friends, search for your life purpose, why are we here?? I advise you to watch this series 👇 as a beginning to know the purpose of your existence in this life.
      ruclips.net/p/PLPqH38Ki1fy3EB-8xmShVqpbQw99Do2B-

  • @Pedrove545
    @Pedrove545 4 года назад

    Really helpful thx

  • @funchakkar6477
    @funchakkar6477 2 года назад

    Sir, nice video. I'm beginner can you tell me please what's code or how to write api characters. I don't know which Language you use. Html, css, or javascript. How to write like you api characters

  • @jefflo3113
    @jefflo3113 3 года назад +1

    Hi James, Nice video. Im wondering if it is possible to list the characters in alphabetical order? If so how would you do it?

    • @jacksonsingh1380
      @jacksonsingh1380 3 года назад

      if your trying to sort the names in alphabetical order and the element for the name is formatted in full, this is what you want:
      data.sort((a, b) => {
      let splitNameA = a.name.split(" ");
      let splitNameB = b.name.split(" ");
      let lastNameA = splitNameA[splitNameA.length - 1];
      let lastNameB = splitNameB[splitNameB.length - 1];
      if(lastNameA < lastNameB){
      return -1;
      }else if(lastNameA > lastNameB){
      return 1;
      }else{
      return 0;
      }
      });

  • @ankitsharma6408
    @ankitsharma6408 3 года назад

    thank you so much..,

  • @rahula3652
    @rahula3652 3 года назад

    while i using other api file, what are all sholud be changed? plz anyone help me out of this

  • @banseveral8966
    @banseveral8966 3 года назад

    Very nice !

  • @jordanholder5373
    @jordanholder5373 3 года назад

    saved my fucking life thanks

  • @nocturno7887
    @nocturno7887 3 года назад

    Thank you! :)

  • @codedynamics1
    @codedynamics1 3 года назад

    for some unknown reason which is driving me insane - i cannot seem to access the searchBar's id. Im getting null everytime !! i am lost. I used dom manipulation all the time. I can access the input tag by using querySelector but then i cannot grab the value of the element when the user keys up - soooo frustrating and now half the day is done ! 😡

  • @minhazhalim2097
    @minhazhalim2097 5 месяцев назад

    Does not working. it shows error - 'hpCharacters.filter is not a function'

  • @boyxnine7193
    @boyxnine7193 3 года назад +1

    Exactly what i needed !! Thanks its look very simple when you know how to do 😁

  • @swatilekha_roy
    @swatilekha_roy 3 года назад

    Sorry if it's a lame question, but how to set up the api? Actually it's for my project, where I am trying to set up a search bar functionality where the search will filter results according to the "tags" present on each card. Each card may have multiple tags. Many thanks for the tutorial! Much appreciated.

    • @raygud5653
      @raygud5653 3 года назад

      Did you ever figure it out if not i can let you know

    • @swatilekha_roy
      @swatilekha_roy 3 года назад

      Hey thank you so much for replying!!
      I did figure it out in the end, I simply added the tags as multiple class names to the cards and then filtered the results with js.

  • @hamandcheesebakedpotato
    @hamandcheesebakedpotato Год назад

    thank u

  • @chrisdizzle313
    @chrisdizzle313 4 года назад

    I thought this was dope man. I'm going to build this using the same API cuz in also an HP nerd.

  • @funnyanimalworld7579
    @funnyanimalworld7579 2 года назад

    wouldnt it would be more logical if search checked from first letter moving forward and not if letter exist anywhere in the name?