Answer the question
In order to leave comments, you need to log in
How to divide a variable by 2 numbers and check if the first one is greater than or earlier than 130?
How can I make it in JQuery so that when a .box is clicked, it checks that the "data-number" of the clicked .box has the first number (before "x") > or = 130 and displays the corresponding result in alert?
Answer the question
In order to leave comments, you need to log in
$('.box').on('click', function () {
var num = $(this).data('number');
var temp = num.split("x");
var one = temp[0];
var two = temp[1];
if (one >= 130) {
alert('ok!')
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question