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