About 13,300,000 results
Open links in new tab
  1. How to create string with multiple spaces in JavaScript

    Nov 5, 2015 · It is essentially a standard space, the primary difference being that a browser should not break (or wrap) a line of text at the point that this occupies. var a = 'something' + …

  2. How to give space in javascript? - Stack Overflow

    Sep 13, 2011 · Add a space in a javascript line. 3. Remove spaces in a Javascript variable. 7. Add a space between two ...

  3. How to add a space at the end of a string in Javascript

    In place of spaces use the html code   your code will start working, because by default the browser accepts only a single space no matter how many you give. Example: Example: space …

  4. javascript - Detect if string contains any spaces - Stack Overflow

    Oct 25, 2015 · That says: Match the beginning of the string (^) followed by zero or more space characters followed by the end of the string ($). Change the * to a + if you don't want to match …

  5. How to remove spaces from a string using JavaScript?

    May 11, 2011 · On the other hand, \s+ handles wider variety of space characters. Among with \n and \t , it also matches \u00a0 character, and that is what   is turned in, when getting …

  6. How do I add a non-breaking whitespace in JavaScript without …

    Jan 22, 1981 · However, the following adds   as text vs adding a empty space: var foo = document.createElement("span") foo = document.createTextNode(" "); which makes …

  7. How to add spaces between numbers with JavaScript?

    Aug 14, 2015 · If you always want the spaces to be by how far from the right you are, use a lookahead which counts in threes ...

  8. javascript - How to split a string by white space or comma? - Stack ...

    "my, tags are, in here".split(", ") with the splitting sequence swapped will at least split your original string in three parts, after each comma-and-space. If you do want five parts, the answers …

  9. Adding whitespace in a Javascript document.write

    Feb 3, 2016 · To add space in DOM you have to use two 'nbsp;' to print one space like this. document.write('nbsp;'); document.write('nbsp;'); this will print only one space that I found …

  10. javascript - Check if a string has white space - Stack Overflow

    A few others have posted answers. There are some obvious problems, like it returns false when the Regex passes, and the ^ and $ operators indicate start/end, whereas the question is …

Refresh