Introduction:
Here I will explain how to use jQuery
to escape single quote in string or show single quote in string using JavaScript.
Description:
In previous articles I explained jQuery spell checker plugin examples, 4 price range slider plugin examples, jQuery timout function example, jQuery add more or less link to text, create short urls using Google shortner api and many
articles relating to JQuery,
JavaScript, asp.net,
code snippets. Now I will explain how to escape single
quote in string jQuery or JavaScript.
jQuery
Show Single Quote in String
To show string with single quote we need to write the
code as shown below
<script type="text/javascript">
$(function()
{
$('#lbltxt').text('Today\'s Data');
})
</script>
|
If you want to see it in
complete example check below code
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jQuery Show Single Quote in String</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function()
{
$('#lbltxt').text('Today\'s Data');
})
</script>
</head>
<body>
<div>
<label id="lbltxt"
/>
</div>
</body>
</html>
|
If you enjoyed this post, please support the blog below. It's FREE! Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email. |
|||
|
|||
0 comments :
Note: Only a member of this blog may post a comment.