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