xiaolong
xiaolong

Reputation: 1

how to get "alt" of ImageTag from HTML use Htmlparser

As title,I want to get the text of "alt" ,but hava no method in ImageTag of Htmlparser,who can help me, thanks.

Upvotes: 0

Views: 186

Answers (1)

Alexandre Ouicher
Alexandre Ouicher

Reputation: 856

With jquery, you can use:

var TextAlt = $('img').attr('alt');

With Java:

for(Element imgElement : img) {
  String imgAlt = imgElement("alt");
}

Upvotes: 1

Related Questions