Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
Cannot set properties of null (setting 'image')

someone help please my image won’t load and I get a error

document.getElementById("task").image = "url"

I made sure the Id matches the id in html I don’t know what’s wrong

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

You can't use image to change the image of an <img>. To do it you will need to use src. Here is what you need below.

document.getElementById("task").src = "yoururl"
about 4 years ago · Juan Pablo Isaza Relatório

0

To change the image source, you can try the code below.

const img = document.querySelector("task");
img.setAttribute("src", "<url>");

setAttribute() will set the src attribute to your URL of your image.

Make sure to change <url> with your image URL!


You can also use the code below.

const img = document.querySelector("task");
img.src = "<url>";

Setting the source to your URL will correctly render the image.

Make sure to change <url> with your image URL!

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda