How to configure display: inline block on my addClass ()

How to set the range will be display:inline-block

 $("#checking").fadeTo(200, 0.1, function () { $(this).html('Username is not available').addClass('cross').fadeTo(900, 1); }); 

Current output

 <span style="display: inline; opacity: 1;" id="checking" class="cross">Username is not available</span> 

In CSS, I set the inline-block cross-class.

Let me know how to make style="display: inline; opacity: 1;" style="inline-display: inline; opacity: 1;"

+4
source share
1 answer

To set the CSS properties of an element, you can simply use the css() function:

 $('#foo').css('display', 'inline-block'); 

So, in your case, just throw css() into this chain:

 $(this).html('Username is not available').addClass('cross').css('display', 'inline-block').fadeTo(900, 1) 
+6
source

Source: https://habr.com/ru/post/1344557/


All Articles