I currently have an li like so:
<li value="100" data-cost="137.00"><span>100</span></li>
I am trying to access the data attribute cost value.
In this example I would like to get a return of 137.00
I am doing a console log of this since I thought this would work:
console.log($(this).closest("[data-cost]"));
My return shows the entire object and I can see the dataset there:

The reason I'm using closest is because I currently need to select this li when it's clicked so I'm using span to select it.
This is the entire code block to select an element.
$(function(){
jQuery(".po-list li span").on("click", function(){
var span = $(this).clone();
var options_col = $(this).closest('.options-col');
console.log($(this).closest("[data-cost]"));
span.attr('class','cur-option-val');
options_col.find('.cur-option-w .cur-option-val').replaceWith(span);
});
});
As I said above I was expecting this: console.log($(this).closest("[data-cost]")); to return just the value. I tried this:
console.log($(this).closest("[data-cost]").val());
console.log($(this).closest("[data-cost]").text());
Both of those returned the value of the span not of the data-cost