我的JSP页面中有三个单选按钮,一旦选中,我想在单选按钮下面的div中显示所选按钮的值。找到下面的代码。根据所选内容,我希望在显示中显示值。
<div>
<div class="service">
<input type="radio" name="Service" value="Service1 Selected" Checked> <b>Service-1</b></input>
<input type="radio" name="Service" value="Service2 Selected"><b>Service-2</b></input>
<input type="radio" name="Service" value="Service3 Selected"><b>Service-3</b></input>
</div>
<div class="display"></div>发布于 2016-03-25 13:11:18
试试这段代码
$(‘inputname=“服务”’).on(“单击”,函数(){
( $('.display').text($('inputname=Service:checked').val());});
https://stackoverflow.com/questions/36218526
复制相似问题