我想通过选择 radio 按钮更换对应的p border颜色为红色。 有没有高手指点一下?
HTML
<label ><p class="discount"><input type="radio" name="abc">2件999</p></label>
<label ><p class="discount"><input type="radio" name="abc">2件999</p></label>
CSS
.discount{
border: 1px solid #cccccc;
padding:2px;
width:100%;
}
如截图

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
https://jsfiddle.net/rtf6w78b/
css中:
.checktopup{
border: 1px solid #f00;
}
js中,记得引入jquery
$("input").on("click", function() {
})
当选项的checked值为true的时候,添加class