Fri, 17 May 2024


How to specify an event handler with a Function object?

By: Peter, NetArt Media
Mon, 29 June 2020

Take a look at the following simple example which illustrates this.

document.onfocus = new Function("document.bgColor='#ff0000'")


Category: Javascript
Share this post:



See All Scripts






Subscribe for our newsletter

Receive the latest blog posts direct in your mailbox