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

245
Views
Vanilla Javascript Document Write based on ScreenResize

I would like to know why document.write is not working based on screen resize funciton. Following is the code. Can anyone give me an explanation on this. Thanks in Advance

detectDevice=()=>{
    let ww = window.innerWidth;
    if(ww>500) {
        document.write("Its Large Device");
    }
    else {
        document.write("Its Small Device");
    }
}
detectDevice();
window.addEventListener("resize", detectDevice);
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Your code is using the wrong function: let ww = window.innerWidth; instead, use the following:

 let ww = screen.width;
about 4 years ago · Juan Pablo Isaza Report
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!