Search content within the blog

Monday, October 11, 2010

Retrieve DIV value in ASP.NET using jQuery

In this example, we will see how to retrieve and display the value of a div in an alert box, on the button click event.

<html xmlns="">
<head runat="server">
<title>Retrieve Value of DIV in ASP.NET</title>
<script type="text/javascript"

<script type="text/javascript">
$(function() {

$('input[id$=btnClick]').click(function () {
var divValue = $('#div1').html();
return false;



<form id="form1" runat="server">
<div id="div1">Div Sample content</div><br />
<asp:Button ID="btnClick" runat="server" Text="Click" />

No comments:

Post a Comment