Q: 2
Given the JavaScript below:
01 function filterDOM(searchString){
02 const parsedSearchString = searchString && searchString.toLowerCase();
03 document.querySelectorAll('.account').forEach(account => {
04
const accountName = account.innerHTML.toLowerCase();
05
account.style.display = accountName.includes(parsedSearchString) ? /* Insert code here */
06 });
07 }
Which code should replace the placeholder comment on line 05 to hide accounts that do not match
the search string?
Options
Discussion
No comments yet. Be the first to comment.
Be respectful. No spam.