V
V
vegarulez2015-10-16 01:07:31
JavaScript
vegarulez, 2015-10-16 01:07:31

jQuery Find DOM element from html code. How?

Hello! The question is - I'm loading the html file - at the time of loading it is necessary to isolate only one div from it with all the internals and insert it into the page. The question is how to do
jQuery.Find correctly?

var jQ = jQuery.noConflict();
...
function testo() {
jQ.get('p.htm', function (data) {
var result = jQ(data).find('<div class="extPaymentDiv">').html();
alert (result);
  //jQ('#info_uin').html(result);
 	//jQ("#info_uin").show();	
  
});
}


There is clearly an error in the syntax. tell me how to do it right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Taratin, 2015-10-16
@Taraflex

jsfiddle.net/QW01_01/m6xfoykv

M
Maxim, 2015-10-16
@maxpointn2point

var result = jQ(data).find('<div class="extPaymentDiv">').text();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question