JavaScript Project | Create Product Search Engine/Bar/Filter in JavaScript. - Need Your Support Guys. Help Me To Reach 200K SUBSCRIBERS 🔥 More JavaScript Projects: ruclips.net/p/PL9bD98LkBR7P16BndaNtP4x6Wf5Ib85Hm Timestamps: 0:00 Intro 1:41 File Directory 2:40 HTML For Search Bar Interface 4:52 CSS For Styling Search Bar Interface 9:55 Adding Products and Details 11:35 Styling Product Image & Details 14:34 Adding More Products 15:08 Fixing More Products in CSS 16:55 Make Search Bar working in JS 17:33 Creating Function 20:48 Matching Products Showing 23:40 Removing Unmatched Products 24:37 Quick Demonstration (Important) 27:04 Lets See What we have made Download Images: www.patreon.com/posts/58490866
@@Sweet-ex8ln Hey bro.. If you are trying to clear your js concepts by just watching one video.. Then wake up from your sleep. Programming is not for you. Find another passion or field. I have seen people who are sticking to js nearly over a year just to learn the basics. Im not here to demotivate you, just giving you reality check 👍
One of the best out there. I can't thank you enough for this immensely informative and easy-to-understand tutorial. Also, I appreciate the fact that you took the time to explain everything (again) before wrapping up your video. I've happily subscribed and now, I am going to watch all your videos to learn more Javascript. Thank you again mate!
Hello, thank you very much for this wonderful video, but I have a question, if you allow me, how can I hide the list of products where the results appear only when I search from the search bar, for the products I search for??
Hey bro, I tried this out and everything worked except for the objects moving upwards to the search bar itself after searching for them. They usually have a weird margin (i think thats the problem) but I cant find the trigger to my problem. Do you know how to solve this problem?
Thanks for this video, but mine doesn’t work even I copied the code exactly. Const storeitems: HTMLElement | null. This is what I get at the declaration of the pname.
Thank you for all the effort. I have a problem and it seems that it is a repeated problem whenever I write a js code. The js part of the project does not work. What could be the problem. Note: I installed node.js and I put the path in the system variable but still it does not work.
this is the could be the better way to do retrieve data and display using js : const search = () => { const searchBox = document.querySelector("#search-item").value.toUpperCase(); const product = document.querySelectorAll(".product"); product.forEach((productItem) => { const productName = productItem.querySelector("h2").textContent.toUpperCase(); if (productName.includes(searchBox)) { productItem.style.display = ""; // Show the product } else { productItem.style.display = "none"; // Hide the product } }); };
indexOf() returns the position of a specified value in an array. To create For Loop, declaring var i=0 or var x=0 is a must. var i=0 was used here to set a variable before the loop starts. let match = product[i].getElementsByTagName("h2")[0]; ----This was your question---- i here means i number of products (its an assumption) [0] here means he is trying to access the first element of the product and in javascript, 0th product means 1st product. example from W3Schools: const fruits = ["Banana", "Orange", "Apple", "Mango"]; Question: Find the index of Banana. Answer: let index = fruits.indexOf("Banana"); console.log(index); It will log 0 because Banana sits in the 1st position in this array, which is considered as the 0th position in javascript! Counts in JavaScript starts from 0 1 2 3 4 5 etc. Banana 0 Orange 1 Apple 2 Mango 3
"Software engineering is the application of engineering principles to computer hardware and software, usually to solve real-world problems. Computer science is the application of the scientific method to computer software. CS is broader and more abstract and is used for theoretical applications than practical ones" - careerkarma. Please search this question in google. You will get a lot of helpful articles regarding this topic.
match = product[i].getElementsByTagName("h2")[0]; Uncaught TypeError: Cannot read properties of undefined (reading 'getElementsByTagName') at search (index.html:183:36) at HTMLInputElement.onkeyup (index.html:98:106) I am getting this error , how to solve it , the products are being filtered but for every change in the searchbox , the code is generating an error, kindly help me solve this error
Hey, nice video, it help me a lot. One question, if i want to hide the products until the user become to type the name of them, and that moment they start to appear, how can i do it?
I resolve to do: Create a new variable inside search() that is: const is-visible = document.getElementById("product-list") And then, inside the second if, i added to the product[i].style.display = "";: is-visible.classList.remove('overflow-hidden'); is-visible.classList.add('overflow-visible'); Because i use bootstrap 5, but i have an issue. When i delete the letters in the search box, the products doesnt disapear, they all stuck in the screen. Any suggestions?
Hello! Thanks for the video! I am having some trouble getting it to work. Can I show you my code somehow please? I validated the HTML, CSS and JS with online validators and I have no errors. Thanks in advance!
JavaScript Project | Create Product Search Engine/Bar/Filter in JavaScript.
- Need Your Support Guys. Help Me To Reach 200K SUBSCRIBERS 🔥
More JavaScript Projects:
ruclips.net/p/PL9bD98LkBR7P16BndaNtP4x6Wf5Ib85Hm
Timestamps:
0:00 Intro
1:41 File Directory
2:40 HTML For Search Bar Interface
4:52 CSS For Styling Search Bar Interface
9:55 Adding Products and Details
11:35 Styling Product Image & Details
14:34 Adding More Products
15:08 Fixing More Products in CSS
16:55 Make Search Bar working in JS
17:33 Creating Function
20:48 Matching Products Showing
23:40 Removing Unmatched Products
24:37 Quick Demonstration (Important)
27:04 Lets See What we have made
Download Images: www.patreon.com/posts/58490866
Waiting for 100K SUBSCRIBERS 🔥
Bro there is an issue we have to refresh page every time to search new product
Js concept not understand in search engines
@@Sweet-ex8ln Hey bro.. If you are trying to clear your js concepts by just watching one video.. Then wake up from your sleep. Programming is not for you. Find another passion or field. I have seen people who are sticking to js nearly over a year just to learn the basics. Im not here to demotivate you, just giving you reality check 👍
Thank you for this!!!
I tweaked the code according to my requirement and it worked just perfect!!! you are doing a great job !!
You're a great teacher, you should have a coding Bootcamp
Thanks man
One of the best out there. I can't thank you enough for this immensely informative and easy-to-understand tutorial. Also, I appreciate the fact that you took the time to explain everything (again) before wrapping up your video. I've happily subscribed and now, I am going to watch all your videos to learn more Javascript. Thank you again mate!
Im glad that you are enjoying this channel
@@Tech2etc I am indeed enjoying this channel. It's a great discovery.
++++
Pls any one give me the code in comment box
Too good ....just done making this ...and without your help wouldn't be possible... thank you so much 🙏❣️
A super project for beginners to sum up their basic knowledge. Thank you!
tried it..it didnt work...checked for errors no errors..and yet not working
You explain coding JS very well. The best is that you say all that is needed and no more extra stuff said. thanks for sharing.
Hello, thank you very much for this wonderful video, but I have a question, if you allow me, how can I hide the list of products where the results appear only when I search from the search bar, for the products I search for??
Bro...
JavaScript ki playlist upload kijea...
Your teaching method is awesome...
search box not working
I was challanged for an hour to decode an error and guess what?..i found out that I wrote the wrong spelling of character under .
Please mine is still not working. Where I replaced document with storeitems const pname is saying HTMLElement | null
thanks brother . i never see some one like you everything in your video are clear and easy coding thanks a gain bro👑👑
It's not working?
Can you make it so the box and the products only appears when I click on the search box
Did u get the solution? If yes plz share it
thanks for the overflow-y : scroll
and offcourse the whole project its awesome
More projects are coming soon.
Please share this project on your social media. It will help us. Thanks.
This is fantastic. So many possible project ideas based on these functionalities thank you
I don't know what's wrong wit me. I can't fix my problem. my code isn't running.
emcommerce.js:3 Uncaught TypeError: document.getElementsById is not a function
at search (emcommerce.js:3:33)
at HTMLInputElement.onkeyup what to do?
TNice tutorials is absolutly the best video of the world you expaining skills are good and it was a honor to see tNice tutorials vid well done
I love Tech2etc's content very much...
Hey bro, I tried this out and everything worked except for the objects moving upwards to the search bar itself after searching for them. They usually have a weird margin (i think thats the problem) but I cant find the trigger to my problem. Do you know how to solve this problem?
Thanks for this video, but mine doesn’t work even I copied the code exactly. Const storeitems: HTMLElement | null. This is what I get at the declaration of the pname.
Search Box is not working.
Thank you for all the effort. I have a problem and it seems that it is a repeated problem whenever I write a js code. The js part of the project does not work. What could be the problem. Note: I installed node.js and I put the path in the system variable but still it does not work.
thanks a lot sir i finding this method and we get and i emplemet this work fine love you...
Tnx dear
sir mere me ye work Kyun nhi kr rha
na koi error show kr rha hai console me jab ki script show kr rha
plz help me!!
same bro
Dude, there's a much easier way.
const searchSentence = value.trim().toLowerCase()
const result = products.filter(val => val.productName.toLowerCase().includes(searchSentence)
where do you put these 2 lines, what do they do, and what do they replace?
Dude it is showing toUpperCase() undefined what to do...?
Great job! but you declared a variable 'storeitems' and it was not used anywhere.
thanks heaps mate this is something I wanted to implement on my own project and worked perfectly!
Tried checking the code word for word, doesn't work.
Let me know the issue you are facing. Will try to help.
Am facing the same problem
@@Tech2etc same issue I am also facing
same here
@@Tech2etc same issue sirr.. am not getting any error still not working
is there any way i can hide the products but when someone clicks the search bar then products come?
please any one tell me
this is the could be the better way to do retrieve data and display using js :
const search = () => {
const searchBox = document.querySelector("#search-item").value.toUpperCase();
const product = document.querySelectorAll(".product");
product.forEach((productItem) => {
const productName = productItem.querySelector("h2").textContent.toUpperCase();
if (productName.includes(searchBox)) {
productItem.style.display = ""; // Show the product
} else {
productItem.style.display = "none"; // Hide the product
}
});
};
WHY NO LIKES!? THANK YOU! did not understand where was the mistake. same as 100 people above. Your code worked properly.
How it apply in e commerce? I want to create an search bar in the nav bar but the pictures is hidden.
Thank you, you helped me so much! I tried to find how to do that for a long time, i did the same thing with all the pages in my website😃
Keep learning
Wow bro.
You like me. I also tried to do it for a long time
Thank you so much !!
Keep Making such videos more 😍🥰
Thank you sir And sir your way of explaining is great and This video is very useful for those who want a working search bar.
Your Most welcome
pls can you make a video of calculating total price in cart item using javascript
Hello bro.
Thank you.
I liked it. It is the best project I have ever seen. ✊.
I wish you all the best.
Thank you bro.
Ohh thank buddy ,I was looking for a same type of video since so long.
Your most welcome. Please share this project on your social media. Will appreciate that.
Thanks a lot sir, it was really helpful and informative
wow great video, easy to follow and well explained
it was really useful for and i learn a lot spcially css and html and i would to learn javascript with if it is possible
Working properly ..thanks man.
no error but it does not work
please check the code again.
thankyou sir, your vid really helped me, it worked on my case
hi, how can i do this with select box buttons? example: "first select box: city , second select box: district, third select box: categories"
how do i initially hide all the products and let them show when some text is written in search bar?
Thank you, Proper explanation. Great work
Great job 10q sir
Your demonstration is perfect 👌
Thank you so much
Will it bring you to another page after you click the selection?
i like the way you explain
Great work.
Its not working
God bless you bro, keep up the good work
very perfect....Create JavaScript projects again, I enjoyed it, thank you
Most welcome
Please check JavaScript projects playlist for more projects like this.
Yes its working
This is nice🔥🔥🍻🍻I'm Glade I came to this video 🔥🔥🔥very nice n clean code
You're very welcome!
More projects are coming soon.
Please share this project on your social media. It will help us. Thanks.
TYYYYYYYYYYY SOOOOOOOOO MUCH
It worked and it was also kinda easy to understand
Thank you
Nicely done. Thank you. Keep up with the good work
Your most welcome. Please share this project on your social media. Will appreciate that.
Good tutorial ! But the search box isn't working , do you have any idea ? all the code is written in the right way
Am having the same problem here,plz help
Same problem bro
same issue too...and there is no error
It's working. Check whether I'd name in html matches with js
hi~
What about adding more search items instead of only one item?
Maa Sha Allah vaiia, Aapni ki Bangladeshi?
superb explination
Hey mahn, this is amazing thank you so much
Your most welcome 😇
Thank you sir I'm having problem in my music player search bar
I have no idea because my code doesnt work
everyone can search with keyword " how to search/ filter list W3School". This code is similar.
Thank you sooo much bro ❤
what is the use of [0] . you write in line no. 8
indexOf() returns the position of a specified value in an array.
To create For Loop, declaring var i=0 or var x=0 is a must.
var i=0 was used here to set a variable before the loop starts.
let match = product[i].getElementsByTagName("h2")[0]; ----This was your question----
i here means i number of products (its an assumption)
[0] here means he is trying to access the first element of the product and in javascript, 0th product means 1st product.
example from W3Schools:
const fruits = ["Banana", "Orange", "Apple", "Mango"];
Question: Find the index of Banana.
Answer:
let index = fruits.indexOf("Banana");
console.log(index);
It will log 0 because Banana sits in the 1st position in this array, which is considered as the 0th position in javascript!
Counts in JavaScript starts from 0 1 2 3 4 5 etc.
Banana 0
Orange 1
Apple 2
Mango 3
Does it work without hosting website
Good voice. Relevant.
This helped so much thank you.
More projects are coming soon.
Please share this project on your social media. It will help us. Thanks.
It Doesnt Work ……
لاقيت يخويا البحث بيتعمل ازاي؟
It is working
@@dayachourasia9968 it's not working
It's working
Could you check have you typed all what sir said
This was awesome!!! Thansk!!!!
thanks broo
Broooo, thankyou so much❤
Thank you so much 🥹
Thanks 🎉
now an input interface would complete this project, it could be adapted to other applications
good! very good expanation
Great Work!
Really appreciate ❤
excellent but let me ask you one question what is the d/ce between software enginner and computer science
"Software engineering is the application of engineering principles to computer hardware and software, usually to solve real-world problems. Computer science is the application of the scientific method to computer software. CS is broader and more abstract and is used for theoretical applications than practical ones" - careerkarma.
Please search this question in google. You will get a lot of helpful articles regarding this topic.
match = product[i].getElementsByTagName("h2")[0];
Uncaught TypeError: Cannot read properties of undefined (reading 'getElementsByTagName')
at search (index.html:183:36)
at HTMLInputElement.onkeyup (index.html:98:106)
I am getting this error , how to solve it , the products are being filtered but for every change in the searchbox , the code is generating an error, kindly help me solve this error
Solution
let match = product[i];
by replacing this we are not getting any error
Hey, nice video, it help me a lot.
One question, if i want to hide the products until the user become to type the name of them, and that moment they start to appear, how can i do it?
I resolve to do:
Create a new variable inside search() that is:
const is-visible = document.getElementById("product-list")
And then, inside the second if, i added to the product[i].style.display = "";:
is-visible.classList.remove('overflow-hidden');
is-visible.classList.add('overflow-visible');
Because i use bootstrap 5, but i have an issue.
When i delete the letters in the search box, the products doesnt disapear, they all stuck in the screen.
Any suggestions?
Thanks , It's work
Hello! Thanks for the video! I am having some trouble getting it to work. Can I show you my code somehow please? I validated the HTML, CSS and JS with online validators and I have no errors. Thanks in advance!
Please join our discord.
@@Tech2etc sir how to join
Thank you, perfect video! But what script should I put if also want to search h3 value?
same process but replace h2 with h3 lol
@@teamofwinter8128 bhai ye < -1 ka kya matlab h js me
sorry > -1 ka
Thanks❤
Can i make with this search engine for buttons
Its for searching txt documents
It's not 🚫 work code eroor
Kindly go for JavaScript dedicated playlist....
I did it doesn't work
sir please my project dose not work please help me
thank you boss
Bro I love You 😍