TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Javascript-Remove Currency from the given user's string.
Ghanashyam Nayak
Apr 30, 2020
7.7
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
This code shows you that how you can remove currency from the given user's input.
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN"
>
<html>
<head>
<title>Sample Code</title>
<script type=
"text/javascript"
>
function
RemoveCurrency(a)
{
if
(a.indexOf(
"$"
) >= 0)
{
a = a.replace(
"$"
,
""
)
}
alert(a)
};
</script>
</head>
<body bgcolor=#00ff00 alink=blue vlink=blue>
<FORM name=
"windowEvent"
>
Enter String : <input type=
"text"
name=
"txtOriginal"
/><br>
<input type=
"button"
value=
"Remove Currency"
name=
"btnRemoveCurrency"
onClick=
"RemoveCurrency(txtOriginal.value);"
/>
</FORM>
</body>
</html>
Javascript-Remove Currency from the given users string.
Next Recommended Reading
Javascript-Remove Comma from the given user's string.