I need some help in converting a javascrpipt function into jQuery. Below is my original JS code:
var text = document.getElementsByTagName("pre")[0].innerHTML;
After a little research on Stack I was able to come up with this equivalent:
var text = $(data).$('pre')[0].html();
Where data is the data I receive in a $.get
request, like below.
$.get (
mypage,
function parse(data) {
var raw = $(data).$('pre')[0].html();
}
);
But that doesn't seem to work and i'm not very good with jQuery.