Build a Library Management System Using html, css, and JavaScript (Source Code) By Faraz



Yüklə 293,01 Kb.
səhifə4/6
tarix22.03.2024
ölçüsü293,01 Kb.
#168954
1   2   3   4   5   6
Build a Library Management System Using HTML

Welcome to My Library







type="text"
class="form-control"
id="User-Name"
aria-describedby="emailHelp"
/>
>We'll never share your user name with anyone else. >









class="form-check-input"
type="radio"
name="check-box"
id="Fiction"
value="Fiction"
/>



class="form-check-input"
type="radio"
name="check-box"
id="Programing"
value="Programing"
/>



class="form-check-input"
type="radio"
name="check-box"
id="Cooking"
value="Cooking"
/>



















Sl No. Date of issue Reader Book Name Genre








Copy
Read Also Create a Responsive Hotel Landing Page to Boost Bookings | HTML, CSS, JavaScript
Step 2 (CSS Code):
No custom CSS thanks to Bootstrap!
/*

No custom CSS thanks to Bootstrap!
https://getbootstrap.com/

*/
Copy
Step 3 (JavaScript Code):
Finally, we need to create a function in JavaScript. Here's an explanation of the code's functionality:

1. Function inputs(userName, bookName, type): This function defines a constructor for creating objects representing book inputs. It takes three parameters: userName (user's name), bookName (name of the book), and type (type of the book).

2. Class Display: This class contains methods to manage the display of book information and interact with the user interface.


  • constructor(): The class constructor, which is empty in this case.

  • add(arrayInputs): This method takes an array of book input objects as a parameter. It generates HTML rows for each input and appends them to a table in the UI.

  • clear(): This method clears the input fields in the form.

  • validate(inputs): This method validates whether the input fields are filled correctly (user name and book name are not empty).

  • alertuser(type, sub, massage): This method adds an alert message to the UI with a specified type (success, danger), subject, and message. The alert is automatically removed after 4 seconds.

  • checkIssue(listArray, o1): This method checks whether a book is already issued by searching the listArray of book inputs. If the book is issued, it returns 0; otherwise, it returns 1.



Yüklə 293,01 Kb.

Dostları ilə paylaş:
1   2   3   4   5   6




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©www.genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə