#DOM Operations For instructions on how to run the tests, check the following link: https://github.com/TelerikAcademy/JavaScript-UI-and-DOM/blob/master/README.md#user-content-preparing-the-local-machine-for-unit-testing-with-mocha-and-chai
##Task 1 Create a function that takes a selector and COUNT, then generates inside a UL with COUNT LIs:
- The UL must have a class
items-list - Each of the LIs must:
- have a class
list-item - content "List item #INDEX"
- The indices are zero-based
- have a class
- If the provided selector does not selects anything, do nothing
- Throws if
- COUNT is a
Number, but is less than 1 - COUNT is missing, or not convertible to
Number- Example:
- Valid COUNT values:
- 1, 2, 3, '1', '4', '1123'
- Invalid COUNT values:
- '123px' 'John', {}, []
- Valid COUNT values:
- Example:
- COUNT is a
##Task 2 Create a function that takes a selector and:
- Finds all elements with class
buttonorcontentwithin the provided element- Change the content of all
.buttonelements with "hide"
- Change the content of all
- When a
.buttonis clicked:- Find the topmost
.contentelement, that is before another.buttonand:- If the
.contentis visible:- Hide the
.content - Change the content of the
.buttonto "show"
- Hide the
- If the
.contentis hidden:- Show the
.content - Change the content of the
.buttonto "hide"
- Show the
- If there isn't a
.contentelement after the clicked.buttonand before other.button, do nothing
- If the
- Find the topmost
- Throws if:
- The provided ID is not a jQuery object or a
string
- The provided ID is not a jQuery object or a
- Use jQuery!