changing from local function in HTML

changing from function in embedded SVG