Added alert function for both <p> and <img> tag