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

433
Vistas
How to I print a div content using javascript? (by class name and not id)

Hello I have made this To-Do project

enter image description here

And I want to create a button that when you click it, it will print ONLY the todos as shown below (shopping, homework, pay the bills).

So i want to print something like this in the paper:

enter image description here

I have searched it up and I have seen ways that only print the ID of the div. However, in my code I dont use ids. In the javascript and html file of this project, I only use class names. I have tried adding id names too in the divs and then use the js code to print, but it doesnt work because my project only works with classes on the divs.

I am a begginer in javascript, sorry if I dont make this clear enough.

Can someone provide me with a working method?

about 4 years ago · Santiago Trujillo
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