fix inline javascript for address state elements

Fixes #2357