How to choose a random number in jquery?

Good day gentlemen.
Please tell me how to make a selection in jquery a random number, for example when the strong tag gets a value, move on, if not standing still.
<div class="bx">
 <span class="icon"></span>
 <a href="#"></a>
of <strong>2</strong>
<span></span>
 <a class href></a>
</div>
September 26th 19 at 11:52
3 answers
September 26th 19 at 11:54
Solution
if (!$('strong', '.bx').is(':empty')) {
 $('.bx').css('visibility': 'visible');
}


Check for empty element can be more complex.
A little more info here
September 26th 19 at 11:56
Solution
$("div > strong").each(function(){
 var strongStr = $(this).text(),
 strongNum = (strongStr !== "" && strongStr !== undefined ? strongStr.valueOf() : undefined);
 if (strongNum && strongNum > %minimum% && strongNum < %max%){
вызов_функции_которая_что_то_делает_с_элементом(this);
}
});
September 26th 19 at 11:58
Math.random() ))
And so the question is not very clear
There is a div with the class bx it default to visibility:hidden, but after strong falls in the value of div with the class bx needs to change the value to visibility:visible. - nigel_Jast87 commented on September 26th 19 at 12:01

Find more questions by tags jQuery