How to find the parent element using javascript

后端 未结 2 1492
情歌与酒
情歌与酒 2020-12-25 10:00

I want to change the background color of the table cell when radio button inside the cell is clicked.

2条回答
  •  死守一世寂寞
    2020-12-25 10:36

    Use the change event of the select:

    $('#my_select').change(function()
    {
       $(this).parents('td').css('background', '#000000');
    });
    

提交回复
热议问题