Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 1.86 KB

README.md.md

File metadata and controls

31 lines (19 loc) · 1.86 KB

This is a simple blog search application that allows users to search for blogs by title, tags, and clubs. The application is built using HTML, CSS, and JavaScript.

Running the Application

Code Explanation

The code for the blog search application is divided into three files:

  • index.html: This file contains the HTML code for the application.
  • script.js: This file contains the JavaScript code for the application.
  • styles.css: This file contains the CSS code for the application.

The index.html file contains the basic HTML structure of the application. It includes the HTML code for the header, navigation bar, and main content area. The script.js file contains the JavaScript code for the application. It includes the code for filtering and displaying the blogs. The styles.css file contains the CSS code for the application. It includes the styles for the header, navigation bar, and main content area.

Step-by-Step Explanation

The following is a step-by-step explanation of the code in the script.js file:

  1. The blogs variable is defined. This variable contains the sample data for the blogs.
  2. The displayBlogs() function is defined. This function filters and displays the blogs.
  3. The searchInput variable is defined. This variable contains the value of the search input field.
  4. The tagFilter variable is defined. This variable contains the value of the tag filter input field.
  5. The clubFilter variable is defined. This variable contains the value of the club filter input field.
  6. The filteredBlogs variable is defined. This variable contains the filtered blogs.
  7. The blogResults variable is defined. This variable contains the HTML element for the blog results.
  8. The innerHTML property of the blogResults variable is set to an empty string. This removes any existing blog results.
  9. If the filteredBlogs array is empty