jquery replace multiple words
// jQuery search and replace space in 10 digit phone number with dots (.)
(".some-class").each(function() {
var text = $(this).html();
// Start search at "Phone: " then 3 digits space 3 digits space 4 digits
// "Phone: 901 123 4567" -> "Phone: 901.123.4567"
text = text.replace(/Phone: (\d{3}) (\d{3}) (\d{4})/, "Phone: $1.$2.$3");
$(this).html(text);
});
Also in JavaScript:
- how to trigger an event on reload js
- find and replace value in array of objects javascript
- acer swift 5
- set localstorage
- angular this web site use cookie example
- get ckeditor textarea value in jquery
- install cypress
- jquery scroll to top of div animate
- discord.js role permissions
- Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied
- react $ r component instance console
- javascript remove item onclick
- node js express url parameters
- ajax data not reflecting after refresh particular div jquery
- javascript push all elements of array to another array
- js convert obj to array
- discord.js guildMemberAdd
- how to get the number of days in a month in javascript
- javascript looping through object
- jquery for bootstrap 4
- tolocalestring javascript currency fixing 2 decimal places
- get page link angular
- how to push mutual array elements in an array nested loop javascript
- discord js people in voice channel