In this article, We will explain to you how to remove all space from the string(jQuery Remove All Space From String), here we will give you a simple example of How to remove spaces from a string using JQuery.
sometimes we need to remove all spaces from a string, then jquery can easily remove spaces from a string.
sometimes use the trim function to remove space from a string but here all spaces remove from a string, so here used replace function.
See below example
<html> <head> <title>jQuery Remove All Space From String - xpertphp</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> </head> <body> <div> <h1>jQuery Remove All Space From String - xpertphp</h1> <input class="txtDescription" name="txtDescription" value="jQuery Remove All Space From String"> <button>Remove</button> </div> <script type="text/javascript"> $("button").click(function(){ var txtDescription = $(".txtDescription").val(); var data = txtDescription.replace(/\s/g, ''); alert(data); //output //jQueryRemoveAllSpaceFromString }); </script> </body> </html>
Please follow and like us:
He Makes Money Online WITHOUT Traffic?
Most people believe that you need traffic to profit online…
And for the most part, they’re right!
Fact is.. 99.99% of methods require you to have traffic.
And that in itself is the problem..
Because frankly, getting traffic is a pain in the rear!
Don’t you agree?
That’s why I was excited when a good friend told me that he was profiting, but with ZERO traffic.
I didn’t believe him at first…
But after he showed me the proof, it’s certainly the real deal!
I’m curious what your thoughts are.
Click here to take a look >> https://bit.ly/3mOAfVp
Please view it before it’s taken down.