How do I set display:inline-block on my addClass()
How do I set my span will be d开发者_JAVA技巧isplay: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 have set the cross class is inline-block
.
Let me know how to make the style="display: inline; opacity: 1;"
will be style="inline-display: inline; opacity: 1;"
To set the CSS properties of a element, you can just use the css()
function:
$('#foo').css('display', 'inline-block');
So in your case, just throw css()
into that chain:
$(this).html('Username is not available').addClass('cross').css('display', 'inline-block').fadeTo(900, 1)
精彩评论