Skip to content

Tag: object

onchange property doesn`t work in javascript

I want to launch the function test() if the user inputs something in the html input field with the id=”sc1dc1″ (without using the “onchange=” directly in HTML). What is wrong? HTML: Javascript: Answer The thing about onchange events is that they only fire when the <input> field l…

Create object from another one using filter function

I’m trying to create an array of objects using an array of objects. My first array is like that : And I want to create an object list with only an id, a name and a task. This is what i do actually, but it doesn’t work : The ListModel object is : Answer The filter() function is more-so utilized

Search value in JSON and return to console

I am trying to search a value in a JSON file using a input field from the user through the browser. A sample JSON object from the array of objects looks like this: I have an event listener to wait for click from the user. After the user clicks the function will go to the api json site and retrieve