Visual tracking is a quite challenging issue for a moving robot due to the appearance changes of both the background and targets, large variation of motion, partial or full occlusion and so on. However, humans are capable to cope with those difficulties to achieve satisfactory tracking performance. Thus this paper presents a biologically-inspired method of visual tracking for moving robots by using object-based visual attention mechanism. This tracking method consists of four modules: pre-attentive segmentation, top-down attentional biasing, post-attentive completion processing and online learning of the target model. Experimental results in natural and cluttered scenes are shown to validate this general and robust tracking method.