I am trying to find an exact copy of html code in a document.
I have tried
$("#tabs-1").find('div:contains(a)').html()
HTML:
<div class="appointment" data-status="yes">
<a class="app">Yuri G.</a>
</div>
Does jquery provide any function for this or do I have to use Regex?
Update: I have multiple divs with with class appointments, with same attributes in a different div container element. I am trying to copy them to another place by drag and drop. I want to make sure that copy does not already exist in the drag and drop place
:containsis for text, try using:hasinstead.Or if you want the entire div as a string, you need to use
outerHTML:DEMO: http://jsfiddle.net/SupSA/