Reputation: 41
const filterField = {
searchText: ''
//Empty value to change over time.
}
const renderNotes = function (notes, filters) {
const filteredNotes = notes.filter(function (note) {
return note.title.toLowerCase().includes(filters.searchText.toLowerCase())
})
console.log(filteredNotes)
}
renderNotes(habits, filterField)
//This function is supposed to change the value of the filteredField object.
document.querySelector('#search-text').addEventListener('input', function (e) {
filterField.searchText === e.target.value;
renderNotes(habits, filterField);
} )
The last method is supposed to change the value of the filterfield object. But it won't change.
I am following a tutorial on udemy and am stuck on this part.
Upvotes: 0
Views: 38
Reputation: 21
filterField.searchText === e.target.value;
Too many equal signs:
change to
filterField.searchText = e.target.value;
Upvotes: 2