$('span').click(function(){ var $this = $(this); if(!$this.data('changed')){ $this.data('changed', true); $this.html(' '); } }).blur(function(){ var $this = $(this); var trimmedText = $this.text().trim(); if(trimmedText == "" || trimmedText == "."){ $this.text('Try me here '); $this.data('changed', false); } });