Simple line of code:
var page=jQuery("#buy-items-button").attr('id');
Problem is that page
is undefined
. Relevant portion of html
<li><a id='#buy-items-button' href="#buy-items" data-page="buy-items" class="section-button">Buy Items</a></li>
console.log(jQuery("#buy-items-button"))
shows:
[context: document, selector: "#buy-items-button", jquery: "1.9.1", constructor: function, init: function…]
context: document
selector: "#buy-items-button"
__proto__: Object[0]
Driving me crazy as having been using jQuery for long and never faced issues on such trivial calls.