2

I have been working with ajax and I have retrieved some data, I want to extract a url from an href attribute, with specific class name. I need a javascript regex for it to extract me the url from that bunch of data. The URL from that data should look like this.

https://www.facebook.com/username

Image Link, this image shows the data, and its specific class name and the url in the href, I want to extract that url, fro, through that specific class name. The class name is : class="_2s25 _606w"

Nadeem
  • 145
  • 1
  • 13

1 Answers1

2

Solution : $(data).find('._2s25 ._606w').attr('href');.

Reference:- Parsing returned HTML from jQuery AJAX request

Alive to die - Anant
  • 70,531
  • 10
  • 51
  • 98
Nadeem
  • 145
  • 1
  • 13