as you have written it, yes. the second line inserts the string $( '#greatphoto' ).attr( 'title')+ - photo by Kelly Clark (as you’ve quoted it all). but even without the quote issue it’s better to not fetch the element(s) you’re working on a second time (DOM access is costly, no matter which framework you use).