Use bindings in jquery instead.