Skip to content

Tag: javascript

regexp highlight search matching numbers

I’ve got a script from a friend, and tried to modified it. So that it highlights a string of numbers in a div. The problem is, that the output of the highlighted text becomes the regexp. Any solutions, what I’m doing wrong? https://jsfiddle.net/rrggrr/kgd4swha/6/ Answer Here’s a simple way o…

How can I fill an empty JavaScript array?

I’ve looked all over online for something that could aid me to fill an empty array with given values the user inputs from a text box that will get stored inside an array. So far I have the following code: When I input something in the textbox and see what happens in the console it tends to replace the p…