How to get entire html code of a div in jquery -
i developing application in asp.net. in web page (.aspx) have multiple div. requirement getting entire html code of particular div including code of specified div. how can that?
<div class="tab-pane" style="width: 348px; height: 204px; margin: 0 auto; background-color: #ffffff; border: none; display: block; position: relative; overflow: hidden; -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);" id="back"> <div class="setlimit" style="width: 324px; height: 180px; margin: 12px; background-color: none; position: absolute; z-index: 51; overflow: visible;" id="safezoneback"> <div id="customizepanelback" style="position: absolute; width: 100%; height: 100%; display: block;"> <div id="lblback" style="position: absolute; background-color: none; text-align: center; font-family: arial; font-size: 12pt; color: #000000; text-transform: none; overflow: hidden; z-index: 80; width: 324px; height: 20px; line-height: 20px; top: 80px; left: 0px;"> <label id="lbltextback">thank you</label> </div> </div> </div> <div class="one" id="cutbacktop" style="background: url(images/dot-line.jpg) repeat-x; width: 100%; height: 1px; position: absolute; top: 6px; left: 0px;"></div> <div class="two" id="cutbackbottom" style="background: url(images/dot-line.jpg) repeat-x; width: 100%; height: 1px; position: absolute; top: 197px; left: 0px;"></div> <div class="three" id="cutbackleft" style="background: url(images/dot-line.jpg) repeat-y; width: 1px; height: 100%; position: absolute; top: 0px; left: 6px;"></div> <div class="four" id="cutbackright" style="background: url(images/dot-line.jpg) repeat-y; width: 1px; height: 100%; position: absolute; top: 0px; left: 341px;"></div>
for above code writing following code
var fronthtmlcode; fronthtmlcode = $("#back").html(); alert(fronthtmlcode);
then showing
<div class="setlimit" style="width: 324px; height: 180px; margin: 12px; background-color: none; position: absolute; z-index: 51; overflow: visible;" id="safezoneback"> <div id="customizepanelback" style="position: absolute; width: 100%; height: 100%; display: block;"> <div id="lblback" style="position: absolute; background-color: none; text-align: center; font-family: arial; font-size: 12pt; color: #000000; text-transform: none; overflow: hidden; z-index: 80; width: 324px; height: 20px; line-height: 20px; top: 80px; left: 0px;"> <label id="lbltextback">thank you</label> </div> </div>
not parent div code. please me.
to div elements including div:
var fronthtmlcode; fronthtmlcode = $("#back").parent().html(); alert(fronthtmlcode);
checkout fiddle
please let me know if helpful or if have queries.
Comments
Post a Comment