How html/javascript interact