how to add variable in href link code example Example: store a href in a variable var xyz = $(selector).attr('href');