Skip to content

Tag: javascript

Regex pattern for Malaysian mobile phone Number

Regex pattern ^(+?6?01)[0|1|2|3|4|6|7|8|9]-*[0-9]{7,8}$ in HTML5 input return error. I tested the regex, no errors on regex101.com as well as in my php code. But in HTML5 it does not function as it be. My code: Error: textfield.js:146 Pattern attribute value ^(+?6?01)[0|1|2|3|4|6|7|8|9]-*[0-9]{7,8}$ is not a …

How to customize arrow buttons in Swiper

How can I customize the arrow buttons below from swipers? I did it crudely but it does not seem to be the right way because I get some margin on the right of the button. The entire code: I don’t want the margin. Any ideas? EDIT: How do I change the colour blue on the arrow to black? Does not

How to zoom a three.js scene with the mouse wheel?

I have a simple three.js graphics, and I tried to use the answers in this and this question to make the created plot zoomable by the mouse wheel. By using the mouse wheel I would like to zoom in to the graphics or to zoom out. Here is the complete code: pastebin link However, when turning the mouse wheel noth…

Javascript Equivalent to C# LINQ GroupBy

This is a follow up question to the following question: Javascript Equivalent to C# LINQ Select We are using Angular 2 + TypeScript: I have an Array of objects. Each object in the array include a property called ‘StudentType’. I need to run a C# LINQ style query that extract a list of StudentType …