Update attribute of HTML

how can I update the attribute of HTML tag using callbacks ?