I have a span
that shows values from a range noUISlider, of that span
I want to take the value it throws when I move the selector and store it to use it in a mathematical operation (multiply I divide by another value) and that result show it on the site
Reference image
It is seen that there is a minimum and maximum range, both values will have a conversion. As it is a WordPress plugin, I only have access to the following code generated in HTML:
<div class="price-slider price">
<span id="price-value-min">9.350</span>
<span class="separator">UF </span>
<span id="price-value-max">38.500</span>
</div>
<input type="hidden" name="price_min" id="min-value" value="9.350">
<input type="hidden" name="price_max" id="max-value" value="38.500">
The input values change when swiping, it's those values that I need to capture
I currently have this, but I can not show any value
jQuery(document).ready(function( $ ) {
// $ Works! You can test it with next line if you like
// console.log($);
$('#price-value-min').click(function() {
var x = $(this).val();
// alert(x);
// Recomiendo usar la consola en lugar de alerts
console.log('El valor es: ' + x);
});
});
It is worth mentioning that these values change
Thankful.