Skip to content

text box that goes to website when answer is correct

I need the user to type a word and if its the right keyword, I need it to change pages. my code for example I want something a bit like this. Answer In the solution below, the user input is evaluated to enable/disable the disabled attribute of the submit button.

filter array based on another arrays dynamically

I am new to JS. I want to apply filter on array based on other arrays. For example : Filter data array based on property names from colNames and values from Values array. The colNames and Values arrays can have any length (not always 2). Expected Outcome Answer You could filter with the iteration of all keys …

How to find item in array in React

I want to retrieve data from a json file and then match it with the value of an existing variable and if the variable value matches the data in json it will display a message “a” and if it does not match it will display a message “b”. the json file is like this Answer What you want is …

How to change text on mouse event in React

I’m trying to use the onMouseDown event in react to change the text but it doesn’t work. I saw a similar code which actually worked so I have no idea what could be wrong. Console says Uncaught TypeError: this.setState2 is not a function The first state which changes images on button click actually…