Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

119
Vistas
How do I make the companyWebsite fetch show up on my browser as a clickable link

I'm fetching company data such as the logo, company title, description and website. When the website comes through, it is a regular text string. I would like it to show up on the browser as a clickable link.

function getCompanyProfile(symbol) {
  const url = `https://.appspot.com/api/v3/company/profile/${symbol}`;
  fetch(url)
    .then((response) => response.json())
    .then((data) => {
      const profile = data.profile;
      companyTitle.textContent = profile.companyName;
      companyWebsite.textContent = profile.website;
      companyDescription.textContent = profile.description;
      price.textContent = "Stock Price: $" + profile.price;
      let profileChangesPercent = Number(profile.changesPercentage);

      if (profileChangesPercent >= 0) {
        changesPercentage.classList.add("green");
      } else if (profileChangesPercent < 0) {
        changesPercentage.classList.add("red");
      }
      changesPercentage.textContent = profileChangesPercent.toFixed(2) + "%";
      // set logo
      let img = document.createElement("img");
      img.src = profile.image;
      companyLogo.appendChild(img);
      console.log(data);
    })
    .catch((err) => {
      console.warn("Something went wrong.", err.message);
    });
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You could change companyWebsite.textContent = profile.website; to companyWebsite.innerHTML = "<a href='" + profile.website + "'>Hyperlink Text</a>"

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda