开发者

grayout the text of disabled radiobutton

i have disabled the radio buttons on the click of previous radiobutton but i also want to grayout the text of the disabled radiobutton can you please help me. Please find the below code that i have done to disable the radiobuttons:

<script type="text/javascript">

    $('input[name=SELECT___2100___32]:eq(0)').click(function() {

        $('input[name=SELECT___2100___33]:eq(2)').val().hide();

        //        alert("hello");
        $('input[name=SELECT___2100___33]:eq(1)').attr('disabled', 'disabled')
        $('input[name=SELECT___2100___33]:eq(2)').attr('disabled', 'disabled')

        $('input[name=SELECT___2100___33]:eq(3)').attr('disabled', 'disabled')
        $('input[name=SELECT___2100___34]').attr('disabled', 'disabled')
        $('input[name=SELECT___2100___40]:eq(2)').attr('disabled', 'disabled')
        $('input[name=SELECT___2100___40]:eq(3)').attr('disabled', 'disabled')

    });
</script>



<tr>
    <td valign="top" align="right">
        Lens Style:
    </td>
    <td>
    </td>
    <td>
        <input type="radio" onclick="change_option('SELECT___2100___32',this.value)" value="163" name="SELECT___2100___32">
            Computer Lens<br>
        <input type="radio" onclick="change_option('SELECT___2100___32',this.value)" value="110" name="SELECT___2100___32">
            Progressive (No Line), starts from $50.00 [Add $50.00]<br>
        <input type="radio" onclick="change_option('SELECT___2100___32',this.value)" value="111" name="SELECT___2100___32">
            Regular Bifocals (w/Line) [Add $39.00]<br>
        <input type="radio" onclick="change_option('SELECT___2100___32',this.value)" value="112" name="SELECT___2100___32">
            Single Vision for Distance [Add $27.00]<br>
        <input type="radio" onclick="change_option('SELECT___2100___32',this.value)" value="113" name="SELECT___2100___32">
            Single Vision for Reading [Add $27.00]<br>
    </td>
</tr>


<tr>
    <td valign="top" align="right">
        Color Type<font color="#cc0000">*</font>:
    </td>
    <td>
    </td>
    <td>
        <input type="radio" onclick="change_option('SELECT___2100___33',this.value)" value="114" name="SELECT___2100___33">
            Clear [Add $27.00]<br>
        <input type="radio" onclick="change_option('SELECT___2100___33',this.value)" value="117" name="SELECT___2100___33开发者_开发知识库">
            Fashion Tint Sunglasses [Add $39.00]<br>
        <input type="radio" onclick="change_option('SELECT___2100___33',this.value)" value="115" name="SELECT___2100___33">
            Photochromic / Transitions [Add $65.00]<br>
        <input type="radio" onclick="change_option('SELECT___2100___33',this.value)" value="116" name="SELECT___2100___33">
            Polarized Sunglass Lens [Add $75.00]<br>
    </td>
</tr>


If you put the text inside a span you can then use fadeTo to 'gray' out the text.

Example jsFiddle


You can wrap your Text with <span id="xyz"> and toggle a sytle class.

 .disable {
      text-color:#ccc;
 }

 $('input[name=SELECT___2100___33]:eq(1)').attr('disabled', 'disabled')
 $('#163').toggleClass("disable");

 <span id="163">Computer Lens</span>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜