单选按钮换成图片

首先准备两张图片
单选按钮换成图片_第1张图片
单选按钮换成图片_第2张图片

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<style>
			.radio label {
                padding: 7px 0px;
                line-height: 20px;
                position: relative;
                font-weight: normal;
            }
            
            .radio .option {
                width: 15px;
                height: 15px;
                position: absolute;
                top: 10px;
                left: 0px;
                background-size: cover;
                background: url(uncheck.png) no-repeat;
                background-size: cover;
            }
            
            .radio input[type="radio"] {
                display: inline-block;
                margin-right: -3px;
                opacity: 0;
            }
            
            .radio input[type="radio"]:checked+div {
                background: url(check.png) no-repeat;
                background-size: cover;
            }
    </style>
</head>

<body>

		<div class="radio">
		 <label>
				<input type="radio" name="sex" value="" />
				<div class="option"></div>
				<span class="opt-text">PO#</span>
			</label>
			 <label>
				<input type="radio" name="sex" value="" />
				<div class="option"></div>
				<span class="opt-text">CFSIA PO/CUT#</span>
			</label>
        </div>
</body>
</html>

你可能感兴趣的:(js/jQuery)