omega
omega

Reputation: 43833

How to draw image object to canvas when the object is from a jQuery selection?

In jquery, I do a select statement to get a bunch of img tags. But how do I actually get the object of each one of those that I can use with the drawImage function for canvases? Normally what works is the document get element by id.

Thanks.

Upvotes: 1

Views: 275

Answers (1)

Suresh Atta
Suresh Atta

Reputation: 121998

You can get the object by writing $(this)

For example:

   $("img").each(function() {
    console.log($(this).prop("src"));
});

in side the loop on bunch of img tags .

Upvotes: 1

Related Questions