Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

428
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!