Skip to content
Advertisement

Perform Function when Element ID is Visible

I’m attempting to perform a function after an element ID becomes visible on a page. I want to make it so that when an element with the ID #discountbox becomes visible, then peform this function.

This is the javascript I’ve created so far:

JavaScript

Unfortunately, this does not appear to be working.

Advertisement

Answer

I’d tried you code here, and it works.

  • what only i changed is just remove one ‘)'( maybe you alreay knew )
JavaScript

to

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement