- 전체
- HTML
- Web Design (웹디자인)
- XE 응용 개발
- wordpress plugin dev
- Javascript & JavaScript Application
- MEAN Stack : full stack javascript
- angular js & ionic framework
- bootstrap
- WebGL, Three.js and Babylon.js
- restful api design
- mobile web
- node.js 응용
- Cloud Service 응용
- 웹 어셈블리 개발 [WASM, WebAssembly]
- 마이크로서비스, MSA (microservice architecture)
- WebGL / WebGPU
- next.js 개발
- micro frontend (마이크로프론트앤드)
- 전자상거래/쇼핑몰
- 서버 클라우드 (aws, azure, google)
JQuery JQuery로 radio 버튼의 값 가져오기 : How to get the value of selected radio button in a group using jQuery
2019.01.10 17:41
JQuery로 radio 버튼의 값 가져오기
How to get the value of selected radio button in a group using jQuery
Answer: Use the jQuery :checked selector
You can use the jQuery :checked selector in combination with the val() method to find the value of certain radio button inside a group. Here's an example:
Example
Try this code »-
-
<html lang="en">
-
<head> -
<meta charset="UTF-8">
-
<title>jQuery Get Selected Radio Button Value</title>
-
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
-
<script type="text/javascript">
-
$(document).ready(function(){ -
$("input[type='button']").click(function(){ -
var radioValue = $("input[name='gender']:checked").val(); -
if(radioValue){ -
alert("Your are a - " + radioValue); -
} -
}); -
-
}); -
</script> -
</head> -
<body> -
<h4>Please select your gender.</h4> -
<p> -
<label><input type="radio" name="gender" value="male">Male</label> -
<label><input type="radio" name="gender" value="female">Female</label> -
</p> -
<p><input type="button" value="Get Value"></p> -
</body> -
</html>
[출처] https://www.tutorialrepublic.com/faq/how-to-get-the-value-of-selected-radio-button-using-jquery.php
본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
댓글 0
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
|---|---|---|---|---|
| 4 |
[HTML/CSS] 4. 카드형 리스트
| 졸리운_곰 | 2018.08.22 | 1121 |
| 3 | HTML DIV tag : 영역 밖과 안쪽에 여백주기 - 마진과 패딩 Margin / Padding | 졸리운_곰 | 2018.07.12 | 538 |
| 2 |
HTML DIV tag: 테두리 너비 지정하는 방법 - WIDTH : 픽셀(px) 또는 퍼센트(%)
| 가을의곰 | 2017.06.10 | 827 |
| 1 |
SVG by HTML5
| 졸리운_곰 | 2015.11.12 | 463 |

