I have the following div <div data-item-id="0234"> and when I try to access the data with $element.data("itemId") jQuery converts it to int and now i get 234 instead of "0234". Is there any way i can get the actual data "0234" ?
I have the following div <div data-item-id=0234> and when I try to access the
Share
Simply use
.attrinstead ($element.attr('data-item-id');). The docs themselves suggest this.