My colleague uses this code to show an element:
$('selector here').attr('style','display:inline-block');
I normally use this:
$('selector here').css('display','inline-block');
I know inline CSS using the style attribute is a bad practice, but other than that, does any of these two lines result in a higher-precedence CSS, or are these two lines completely identicaly from the point of view of how the element will look like?
I was assuming that .css() may have a lower precedence because inline CSS has a bigger priority.
show()insteadshow()is better?display:nonein the css,show()will adddisplay:blockto thestyleattribute of the element as you can see in this fiddle: jsfiddle.net/vem5qL2c/1