jQuery - get text inside span to align left

Using jQuery - how do I get the text inside of a span to align left?
Tom KnowltonWeb developerAsked:
Who is Participating?
soupBoyConnect With a Mentor Commented:
By default, spans are inline elements and should be aligning left.  

Are you trying to override a css rule?
This could be done easily by css, all JQuery would be doing would be injected css inline...

//using JQuery to build your css
  display: 'inline-block',
  textAlign: 'left'

Open in new window

/*it is better to do it like this*/
  display: inline-block;
  text-align: left;

Open in new window

Tom KnowltonWeb developerAuthor Commented:
I went with:

 $('span[id*="lblDetails"]').css('text-align', 'left');

Maybe not best practice, but more fun with jQuery.  : )
All Courses

From novice to tech pro — start learning today.