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

161
Vistas
Dynamically rendering objects from API in Javascript(object/API/dynamic rendering)

I have an array and objects in it, brought with the help of API. And If I enter name of an object to input it have to find that object and render its other properties to specific tags of HTML which are located in the same container with my input I entered name. Actually this should have done in Javascript.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

First, in order to find an object by its name, you can use arr.filter():

var desiredName = "Name 1" //The name entered into the input
const objects = [{name: "Name 1", name: "Name 2"}] //Your array of objects

//Use arr.filter() to find the item with the desired name
var selectedObject = objects.filter((item) => {
  return item.name = desiredName
})[0] //Target the first element in the returned array

As far as populating paragraph elements with the selected objects properties, you can just use document.getEleemntById():

document.getElementById("someElement").innerHTML = "Your Text"
<p id="someElement"></p>

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