Grow your CSS skills. Land your dream job.

Change color of a Label

  • # September 28, 2009 at 1:47 pm

    Hi

    How can i change the background color of a label when the input is selected. The label in question is for a serie of radio input.

    Thanks a lot for any suggestion

    # September 29, 2009 at 5:32 am

    onClick="if (this.checked){uno.className=’item1′}else{uno.className=’choise’}" :D

    # October 7, 2009 at 11:20 pm

    If you’re using jQuery it’s really easy.

    Code:
    $(‘input’).focus(function() {
    $(this).prev(‘label’).css(‘color’, ‘green’);
    }).blur(function() {
    $(this).prev(‘label’).css(‘color’, ‘blue’);
    });;
    # October 9, 2009 at 1:51 am

    I can’t see the option to change my labels,i’m iu suppose to enable something in order to change the label color.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".