<div class ="test" data-price ="123"></div>
<div class ="test" data-price ="231"></div>
function getElement () {
var onloadDeliveryPrice = document.querySelectorAll('test')[0];
changePrice(onloadDeliveryPrice);
}
function changePrice(element){
var deliveryPrice = element.getAttribute('data-price');
console.log(deliveryPrice);
}