aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

jQuery- Get Div Id Value or Div Content in

Oct 22, 2012

Here I will explain how to get div id value or div content using jQuery in

In previous articles I explained
Redirect to another page after some time delay, jQuery slideUp slideDown toggle effects, jQuery Drag and Drop Example,  and many articles relating to JQuery. Now I will explain how to get div id value or div content using jQuery in

To get div id value or div content we need to write CodeSnippet like as shown below

Get div id or div content

<script type="text/javascript">
$(document).ready(function() {
$('#btnClick').click(function() {
var divtxt = $('#contentdiv').html();
If you want check this code in sample check below code


<html xmlns="">
<head runat="server">
<title>Get div id or content in jQuery</title>
<script type="text/javascript" src="">
<script type="text/javascript">
$(document).ready(function() {
$('#btnClick').click(function() {
var divtxt = $('#contentdiv').html();
<form id="form1" runat="server">
<div id="contentdiv">Welcome to</div>
<br />
<input type="button" id="btnClick" value="Get Div Content" />
Live Demo

To check Live demo click on below button

Welcome to

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


shalinirajapandy said...

i cant download the coding please help me..........

Unknown said...

hello sir thanks for Ur article could u tel me
can we save the div as image in server using Jquery ajax if so is there any sample code
can u help me in this

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.