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

75
Views
Changing document.title through JavaScript anonymous function

I am still a bit new to JavaScript. I am trying to dynamically change the title of a page through javascript. However I am getting a result of undefined. I have tried multiple things and still no luck. What is the right way to pass a value to this anonymous function?

let email = "myemail@email.com"
await page.evaluate(  (email) => document.title = email );
console.log(await page.title());
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I never used playwright js, but reading this documentation page here, https://playwright.dev/docs/evaluating, it looks like you pass arguments for the anonymous function as the second, and next parameters, of the evaluation method:

let email = "myemail@email.com"
await page.evaluate( (email) => document.title = email, email );
console.log(await page.title());
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!