So I have this search box on the main page of my web, and I would like it to serve as a "search a car by name from the gallery (jason file)" and display the car to the user, Now I am not quite sure how to achieve this goal, any help with the actual code would be very appreciated.
My jason file:
{
"cars" :
[
{
"model": "Mazda Nagare",
"year": "2013",
"country": "Japan",
"plate": "y72-28f-609",
"price": "220,000",
"pic" : "images/MazdaNag.jpg"
},
{
"model": "BMW M135i",
"year": "2011",
"country": "Germany",
"plate": "bmw-016-ur2",
"price": "140,000",
"pic" : "images/BMWM135i.jpg"
},
{
"model": "Mazda 6",
"year": "2007",
"country": "Germany",
"plate": "x57-6u6-fev",
"price": "110,000",
"pic" : "images/Mazda6.jpg"
},
{
"model": "Toyota 9T",
"year": "2013",
"country": "Japan",
"plate": "qwe-rty-013",
"price": "390,000",
"pic" : "images/toyota_9turbo.jpg"
},
{
"model": "Toyota GTS",
"year": "2012",
"country": "Japan",
"plate": "6r2-x0r-65y",
"price": "177,000",
"pic" : "images/ToyotaGts.jpg"
},
{
"model": "Toyota GT-86",
"year": "2013",
"country": "Japan",
"plate": "ca1-pw9-n3x",
"price": "260,000",
"pic" : "images/ToyotaGt86.jpg"
}
]
}
My search box and button (Which opens a new blank page, that I made for the search results):
<div id="searchBox" data-theme="a">
<input type="search" placeholder="Search for a car by name">
</div>
<div class="smallButtonStyle">
<input type="button" value="Search" onClick="location.href='#search'" data-icon="arrow-r" data-transition="slide"/>