Subscribe to Subscribers
Talk to Webmaster Tony John


Forums » .NET » JQuery »

How to write to get value inside the tag using jQuery


Posted Date: 19 Jun 2012      Posted By:: Ramasamy.N     Member Level: Gold    Member Rank: 93     Points: 1   Responses: 1




How to write jQuery to retrieve the value 15.

<p class="date">15 <span>%</span></p>

i don't want 15%, i want only 15


pls help me




Responses

#676353    Author: Ultimaterengan        Member Level: Gold      Member Rank: 9     Date: 19/Jun/2012   Rating: 2 out of 52 out of 5     Points: 4


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
<script language="javascript" src="jquery-1.2.6.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#Button1").click(function()
{
var txt = $('#pid').text().replace('%','');
alert(txt);
});



});
</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<p id="pid">15 <span>%</span></p>
<asp:Button ID="Button1" runat="server" Text="Button" />
</form>
</body>
</html>





Thanks & Regards
G.Renganathan
Nothing is mine ,Everything is yours!!!


http://renganathan1984.blogspot.com/



 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : How Redirect to a page from jquerry in hml .
Previous : How to write to set value inside the tag using jQuery
Return to Discussion Forum
Post New Message
Category:

Related Messages



Follow us on Twitter: https://twitter.com/dotnetspider

Active Members
TodayLast 7 Daysmore...

Awards & Gifts
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2012 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.