Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for style="background-image: url('.....') #239

Open
mediabuff opened this issue Apr 12, 2023 · 1 comment
Open

Support for style="background-image: url('.....') #239

mediabuff opened this issue Apr 12, 2023 · 1 comment

Comments

@mediabuff
Copy link

Hi all, does this scenario work ? Does it only work on img tag ?

@artrz
Copy link

artrz commented May 13, 2024

Just create an img and set the src. Something like:

    const img = document.createElement('img');
    img.src = document.querySelector(querySelector).style.backgroundImage.match(/"(.*?)"/)[1];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants