How to create a condition for a strong field?

  • 0
    There is a strong field with a value for example 1 & amp; nbsp100 ₽

    Help me create a condition that if the value in this field is greater than 10, the block is hidden.

    JavaScript Anonymous, Dec 5, 2020

  • 1 Answers
  • 0
    let gd = document.querySelector('#gd');
    let str = gd.innerText;
    let number_gd = parseInt(str.replace(/[^\d]/g, ''));

    if (number_gd > 10)
    document.querySelector('#example').style.visibility = 'hidden';
    Adam Page

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!