I'm trying to get the div element which has the class repeat. So I tried this, but it shows undefined.
var data = '<div class="test form-group col-xs-6 repeat" id="repeat_py">\n <div class="kv col-lg-2">index:\n<pre class="num">0</pre></div>\n<div><span class="kv">value: <pre class="num">m</pre></span></div></div>'
alert($(data).find('div.repeat').html())
datais a string in this context, right? So you need to parse italert($(data).html().find('div.repeat').html())$(data)