Y
Y
Yuri Vitalievich2020-04-23 23:53:01
JavaScript
Yuri Vitalievich, 2020-04-23 23:53:01

Simple JS code for minimum order amount?

Hello everyone, I didn’t find a suitable code ... The crux of the matter ...
There is a basket, there are goods, I didn’t score 1000 rubles in the basket, the checkout button is not available.

I tried to do it, but it doesn't work:
$(function() {
if ($('total').text() < 1000)
$("succes mybtn").css("display", "none")});

Help me please))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav Boychenko, 2020-04-23
@vladislav_boychenko

If the selectors are spelled correctly, then this will work.

$(function() {
  if (parseFloat($('total').text()) < 1000) {
    $("succes mybtn").hide();
  }
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question