store url as variable javascript code example Example: store a tag url in a variable var xyz = $(selector).attr('href');